New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split Comparison Helper #93
Conversation
ed11e74
to
01d3d43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚢
sig { params(address: AbstractAddress, candidate: Candidate, datastore: DatastoreBase).void } | ||
def initialize(address:, candidate:, datastore:) | ||
@comparison_helper = ComparisonHelper.new(address:, candidate:, datastore:) | ||
@street_comparison = StreetComparison.new(address: address, candidate: candidate, datastore: datastore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# typed: true | ||
# frozen_string_literal: true | ||
|
||
module AtlasEngine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
end | ||
|
||
sig { params(candidate: Candidate).returns(T::Array[AddressNumberRange]) } | ||
def building_ranges_from_candidate(candidate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be moved into the BuildingComparison
class, since that is the only subclass which requires it.
01d3d43
to
fddb02f
Compare
fddb02f
to
3508078
Compare
3508078
to
90bc359
Compare
Context
ComparisonHelper is mainly running different field comparisons under methods in the same class. This prevents us from adding flexibility to individual field comparison logic.
This is step 1 of the logic to make the comparison classes configurable by country.
In step 2 we will attempt to simplify the comparison logic to remove the need for external classes to interact with
Token::Sequence::Comparison
Approach
This is a simple refactor and does not bring any change to the logic.
Testing
Checklist