Class: WeatherGov::Product

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

Instance Attribute Summary

Attributes inherited from Feature

#client

Instance Method Summary collapse

Methods inherited from Feature

#context, #data, #geometry, #id, #initialize, #properties, #type

Constructor Details

This class inherits a constructor from WeatherGov::Feature

Instance Method Details

#codeObject



13
14
15
# File 'lib/weather_gov/product.rb', line 13

def code
  data.fetch("productCode")
end

#issuance_timeObject



9
10
11
# File 'lib/weather_gov/product.rb', line 9

def issuance_time
  Time.parse(data.fetch("issuanceTime"))
end

#issuing_officeObject



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

def issuing_office
  data.fetch("issuingOffice")
end

#nameObject



17
18
19
# File 'lib/weather_gov/product.rb', line 17

def name
  data.fetch("productName")
end

#productObject



25
26
27
# File 'lib/weather_gov/product.rb', line 25

def product
  client.product(id: id) if id
end

#textObject



21
22
23
# File 'lib/weather_gov/product.rb', line 21

def text
  data.fetch("productText")
end