Class: GeonamesClient::NearbyStreet
- Inherits:
-
Object
- Object
- GeonamesClient::NearbyStreet
- Defined in:
- lib/geonames_client/nearby_street.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(another_nearby_street) ⇒ Object
- #==(another_nearby_street) ⇒ Object
-
#initialize(options) ⇒ NearbyStreet
constructor
A new instance of NearbyStreet.
Constructor Details
#initialize(options) ⇒ NearbyStreet
Returns a new instance of NearbyStreet.
6 7 8 |
# File 'lib/geonames_client/nearby_street.rb', line 6 def initialize( ) @name = [:name] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/geonames_client/nearby_street.rb', line 4 def name @name end |
Class Method Details
.all(*names) ⇒ Object
10 11 12 |
# File 'lib/geonames_client/nearby_street.rb', line 10 def self.all( *names ) names.map { |name| NearbyStreet.new( :name => name ) } end |
Instance Method Details
#<=>(another_nearby_street) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/geonames_client/nearby_street.rb', line 21 def <=>( another_nearby_street ) return -1 if name < another_nearby_street.name return 1 if name > another_nearby_street.name 0 end |
#==(another_nearby_street) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/geonames_client/nearby_street.rb', line 14 def ==( another_nearby_street ) return false unless another_nearby_street.is_a?( NearbyStreet ) return false unless another_nearby_street.name == name true end |