Class: Asdawqw::NearbyAmenity
- Defined in:
- lib/asdawqw/models/nearby_amenity.rb
Overview
NearbyAmenity Model.
Instance Attribute Summary collapse
-
#attribute_id ⇒ NearbyAmenitiesEnum
Nearby Attributes code.
-
#distance ⇒ Integer
Will be set to 0 by default.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(attribute_id = nil, distance = nil) ⇒ NearbyAmenity
constructor
A new instance of NearbyAmenity.
Methods inherited from BaseModel
Constructor Details
#initialize(attribute_id = nil, distance = nil) ⇒ NearbyAmenity
Returns a new instance of NearbyAmenity.
26 27 28 29 30 |
# File 'lib/asdawqw/models/nearby_amenity.rb', line 26 def initialize(attribute_id = nil, distance = nil) @attribute_id = attribute_id @distance = distance end |
Instance Attribute Details
#attribute_id ⇒ NearbyAmenitiesEnum
Nearby Attributes code. Check all enum types for supported list of amenities.
12 13 14 |
# File 'lib/asdawqw/models/nearby_amenity.rb', line 12 def attribute_id @attribute_id end |
#distance ⇒ Integer
Will be set to 0 by default
16 17 18 |
# File 'lib/asdawqw/models/nearby_amenity.rb', line 16 def distance @distance end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/asdawqw/models/nearby_amenity.rb', line 33 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. attribute_id = hash['attributeId'] distance = hash['distance'] # Create object from extracted values. NearbyAmenity.new(attribute_id, distance) end |
.names ⇒ Object
A mapping from model property names to API property names.
19 20 21 22 23 24 |
# File 'lib/asdawqw/models/nearby_amenity.rb', line 19 def self.names @_hash = {} if @_hash.nil? @_hash['attribute_id'] = 'attributeId' @_hash['distance'] = 'distance' @_hash end |