Class: MatchMate::AddressMatchListItem
- Inherits:
-
Object
- Object
- MatchMate::AddressMatchListItem
- Includes:
- Comparable
- Defined in:
- lib/match-mate/address_match_list.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(address_object_or_string, other_address) ⇒ AddressMatchListItem
constructor
A new instance of AddressMatchListItem.
- #matcher ⇒ Object
Constructor Details
#initialize(address_object_or_string, other_address) ⇒ AddressMatchListItem
Returns a new instance of AddressMatchListItem.
25 26 27 28 29 |
# File 'lib/match-mate/address_match_list.rb', line 25 def initialize(address_object_or_string, other_address) # Accepts any address object that responds to a to_s method @address = address_object_or_string @other_address = other_address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
22 23 24 |
# File 'lib/match-mate/address_match_list.rb', line 22 def address @address end |
Instance Method Details
#<=>(other) ⇒ Object
35 36 37 |
# File 'lib/match-mate/address_match_list.rb', line 35 def <=>(other) other.score <=> score end |
#matcher ⇒ Object
31 32 33 |
# File 'lib/match-mate/address_match_list.rb', line 31 def matcher @matcher ||= AddressMatcher.new(@address, @other_address) end |