Class: WeatherGov::Address
- Inherits:
-
Object
- Object
- WeatherGov::Address
- Defined in:
- lib/weather_gov/address.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #address_locality ⇒ Object
- #address_region ⇒ Object
-
#initialize(data) ⇒ Address
constructor
A new instance of Address.
- #postal_code ⇒ Object
- #street_address ⇒ Object
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
#data ⇒ Object (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_locality ⇒ Object
15 16 17 |
# File 'lib/weather_gov/address.rb', line 15 def address_locality data.fetch("addressLocality") end |
#address_region ⇒ Object
19 20 21 |
# File 'lib/weather_gov/address.rb', line 19 def address_region data.fetch("addressRegion") end |
#postal_code ⇒ Object
23 24 25 |
# File 'lib/weather_gov/address.rb', line 23 def postal_code data.fetch("postalCode") end |
#street_address ⇒ Object
11 12 13 |
# File 'lib/weather_gov/address.rb', line 11 def street_address data.fetch("streetAddress") end |