Class: WeatherGov::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/weather_gov/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Address

Returns a new instance of Address.



7
8
9
# File 'lib/weather_gov/address.rb', line 7

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/weather_gov/address.rb', line 5

def data
  @data
end

Instance Method Details

#address_localityObject



15
16
17
# File 'lib/weather_gov/address.rb', line 15

def address_locality
  data.fetch("addressLocality")
end

#address_regionObject



19
20
21
# File 'lib/weather_gov/address.rb', line 19

def address_region
  data.fetch("addressRegion")
end

#postal_codeObject



23
24
25
# File 'lib/weather_gov/address.rb', line 23

def postal_code
  data.fetch("postalCode")
end

#street_addressObject



11
12
13
# File 'lib/weather_gov/address.rb', line 11

def street_address
  data.fetch("streetAddress")
end