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(city = nil, country = nil, country_code = nil, latitude = nil, line_1 = nil, line_2 = nil, longitude = nil, postal_code = nil, province = nil, state = nil) ⇒ EntitiesAddressEntity
constructor
A new instance of EntitiesAddressEntity.
Methods inherited from BaseModel
Constructor Details
#initialize(city = nil, country = nil, country_code = nil, latitude = nil, line_1 = nil, line_2 = nil, longitude = nil, postal_code = nil, province = nil, state = 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(city = nil, country = nil, country_code = nil, latitude = nil, line_1 = nil, line_2 = nil, longitude = nil, postal_code = nil, province = nil, state = nil) @city = city @country = country @country_code = country_code @latitude = latitude @line_1 = line_1 @line_2 = line_2 @longitude = longitude @postal_code = postal_code @province = province @state = state end |
Instance Attribute Details
#city ⇒ String
city of Address
7 8 9 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 7 def city @city end |
#country ⇒ String
country of Address
11 12 13 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 11 def country @country end |
#country_code ⇒ String
country code of Address
15 16 17 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 15 def country_code @country_code end |
#latitude ⇒ String
latitude of Address
19 20 21 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 19 def latitude @latitude end |
#line_1 ⇒ String
line 1 of Address
23 24 25 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 23 def line_1 @line_1 end |
#line_2 ⇒ String
line 2 of Address
27 28 29 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 27 def line_2 @line_2 end |
#longitude ⇒ String
longitude of Address
31 32 33 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 31 def longitude @longitude end |
#postal_code ⇒ String
postal code of Address
35 36 37 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 35 def postal_code @postal_code end |
#province ⇒ String
province of Address
39 40 41 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 39 def province @province end |
#state ⇒ String
state of Address
43 44 45 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 43 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 113 114 |
# File 'lib/gonebusy/models/entities_address_entity.rb', line 86 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash city = hash["city"] country = hash["country"] country_code = hash["country_code"] latitude = hash["latitude"] line_1 = hash["line1"] line_2 = hash["line2"] longitude = hash["longitude"] postal_code = hash["postal_code"] province = hash["province"] state = hash["state"] # Create object from extracted values EntitiesAddressEntity.new(city, country, country_code, latitude, line_1, line_2, longitude, postal_code, province, state) end 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["city"] = "city" @hash["country"] = "country" @hash["country_code"] = "country_code" @hash["latitude"] = "latitude" @hash["line_1"] = "line1" @hash["line_2"] = "line2" @hash["longitude"] = "longitude" @hash["postal_code"] = "postal_code" @hash["province"] = "province" @hash["state"] = "state" end @hash end |