Class: GeoMagic::Location::City

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_magic/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, zipcode, metrocode) ⇒ City

Returns a new instance of City.



27
28
29
30
31
# File 'lib/geo_magic/location.rb', line 27

def initialize name, zipcode, metrocode
  @name = name
  @zipcode = zipcode        
  @metrocode = metrocode
end

Instance Attribute Details

#metrocodeObject

Returns the value of attribute metrocode.



25
26
27
# File 'lib/geo_magic/location.rb', line 25

def metrocode
  @metrocode
end

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/geo_magic/location.rb', line 25

def name
  @name
end

#zipcodeObject

Returns the value of attribute zipcode.



25
26
27
# File 'lib/geo_magic/location.rb', line 25

def zipcode
  @zipcode
end

Instance Method Details

#to_sObject



33
34
35
# File 'lib/geo_magic/location.rb', line 33

def to_s
  "city: #{name}#{zip_str}#{metro_str}"
end