Class: Tpaga::City

Inherits:
BaseObject show all
Defined in:
lib/tpaga/models/city.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash

Constructor Details

#initialize(attributes = {}) ⇒ City

Returns a new instance of City.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/tpaga/models/city.rb', line 31

def initialize(attributes = {})
  return if !attributes.is_a?(Hash) || attributes.empty?

  # convert string to symbol for hash key
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}

  
  if attributes[:'name']
    @name = attributes[:'name']
  end
  
  if attributes[:'state']
    @state = attributes[:'state']
  end
  
  if attributes[:'country']
    @country = attributes[:'country']
  end
  
end

Instance Attribute Details

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/tpaga/models/city.rb', line 4

def country
  @country
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/tpaga/models/city.rb', line 4

def name
  @name
end

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/tpaga/models/city.rb', line 4

def state
  @state
end

Class Method Details

.attribute_mapObject

attribute mapping from ruby-style variable name to JSON key



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tpaga/models/city.rb', line 6

def self.attribute_map
  {
    
    # 
    :'name' => :'name',
    
    # ISO 3166-2 code for state
    :'state' => :'state',
    
    # ISO 3166-1 Alpha 2 code for country
    :'country' => :'country'
    
  }
end

.swagger_typesObject

attribute type



22
23
24
25
26
27
28
29
# File 'lib/tpaga/models/city.rb', line 22

def self.swagger_types
  {
    :'name' => :'string',
    :'state' => :'string',
    :'country' => :'string'
    
  }
end