Class: MapmyindiaRuby::GeoAddr

Inherits:
Object
  • Object
show all
Defined in:
lib/mapmyindia_ruby/geoaddr.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ GeoAddr

Returns a new instance of GeoAddr.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 13

def initialize(attributes)
  @country = attributes["country"]
  @city = attributes["city"]
  @area = attributes["area"]
  @PLZ = attributes["PLZ"]
  @street = attributes["street"]
  @house_no = attributes["house_no"]
  @POI = attributes["POI"]
  @phone = attributes["phone"]
  @lng = attributes["lng"]
  @lat = attributes["lat"]
  @type = attributes["type"]
  @entries = attributes["entries"]
  @formatted_address = attributes["formatted_address"]
end

Instance Attribute Details

#areaObject (readonly)

Returns the value of attribute area.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def area
  @area
end

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def country
  @country
end

#entriesObject (readonly)

Returns the value of attribute entries.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def entries
  @entries
end

#formatted_addressObject (readonly)

Returns the value of attribute formatted_address.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def formatted_address
  @formatted_address
end

#house_noObject (readonly)

Returns the value of attribute house_no.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def house_no
  @house_no
end

#latObject (readonly)

Returns the value of attribute lat.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def lat
  @lat
end

#lngObject (readonly)

Returns the value of attribute lng.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def lng
  @lng
end

#phoneObject (readonly)

Returns the value of attribute phone.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def phone
  @phone
end

#PLZObject (readonly)

Returns the value of attribute PLZ.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def PLZ
  @PLZ
end

#POIObject (readonly)

Returns the value of attribute POI.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def POI
  @POI
end

#streetObject (readonly)

Returns the value of attribute street.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def street
  @street
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 4

def type
  @type
end

Class Method Details

.build(addrs) ⇒ Object



7
8
9
10
11
# File 'lib/mapmyindia_ruby/geoaddr.rb', line 7

def self.build(addrs)
  addrs.collect do |addr|
    GeoAddr.new(addr)
  end
end