Class: Gonebusy::EntitiesAddressEntity
- Defined in:
- lib/gonebusy/models/entities_address_entity.rb
Instance Attribute Summary collapse
-
#city ⇒ String
city of Address.
-
#country ⇒ String
country of Address.
-
#country_code ⇒ String
country code of Address.
-
#latitude ⇒ String
latitude of Address.
-
#line_1 ⇒ String
line 1 of Address.
-
#line_2 ⇒ String
line 2 of Address.
-
#longitude ⇒ String
longitude of Address.
-
#postal_code ⇒ String
postal code of Address.
-
#province ⇒ String
province of Address.
-
#state ⇒ String
state of Address.
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(line_1 = nil, line_2 = nil, city = nil, state = nil, province = nil, postal_code = nil, country = nil, country_code = nil, latitude = nil, longitude = nil) ⇒ EntitiesAddressEntity
constructor
A new instance of EntitiesAddressEntity.
Methods inherited from BaseModel
Constructor Details
#initialize(line_1 = nil, line_2 = nil, city = nil, state = nil, province = nil, postal_code = nil, country = nil, country_code = nil, latitude = nil, longitude = nil) ⇒ EntitiesAddressEntity
Returns a new instance of EntitiesAddressEntity.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 63 def initialize(line_1 = nil, line_2 = nil, city = nil, state = nil, province = nil, postal_code = nil, country = nil, country_code = nil, latitude = nil, longitude = nil) @line_1 = line_1 @line_2 = line_2 @city = city @state = state @province = province @postal_code = postal_code @country = country @country_code = country_code @latitude = latitude @longitude = longitude end |
Instance Attribute Details
#city ⇒ String
city of Address
15 16 17 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 15 def city @city end |
#country ⇒ String
country of Address
31 32 33 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 31 def country @country end |
#country_code ⇒ String
country code of Address
35 36 37 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 35 def country_code @country_code end |
#latitude ⇒ String
latitude of Address
39 40 41 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 39 def latitude @latitude end |
#line_1 ⇒ String
line 1 of Address
7 8 9 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 7 def line_1 @line_1 end |
#line_2 ⇒ String
line 2 of Address
11 12 13 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 11 def line_2 @line_2 end |
#longitude ⇒ String
longitude of Address
43 44 45 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 43 def longitude @longitude end |
#postal_code ⇒ String
postal code of Address
27 28 29 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 27 def postal_code @postal_code end |
#province ⇒ String
province of Address
23 24 25 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 23 def province @province end |
#state ⇒ String
state of Address
19 20 21 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 19 def state @state end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 86 def self.from_hash(hash) return nil unless hash # Extract variables from the hash line_1 = hash['line1'] line_2 = hash['line2'] city = hash['city'] state = hash['state'] province = hash['province'] postal_code = hash['postal_code'] country = hash['country'] country_code = hash['country_code'] latitude = hash['latitude'] longitude = hash['longitude'] # Create object from extracted values EntitiesAddressEntity.new(line_1, line_2, city, state, province, postal_code, country, country_code, latitude, longitude) end |
.names ⇒ Object
A mapping from model property names to API property names
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 46 def self.names if @_hash.nil? @_hash = {} @_hash["line_1"] = "line1" @_hash["line_2"] = "line2" @_hash["city"] = "city" @_hash["state"] = "state" @_hash["province"] = "province" @_hash["postal_code"] = "postal_code" @_hash["country"] = "country" @_hash["country_code"] = "country_code" @_hash["latitude"] = "latitude" @_hash["longitude"] = "longitude" end @_hash end |