class WeatherGov::Feature

Attributes

client[R]

Public Class Methods

new(client:, data:) click to toggle source
# File lib/weather_gov/feature.rb, line 7
def initialize(client:, data:)
  @client = client
  if data.respond_to?(:call)
    @data_proc = data
  else
    @data = data
  end
end

Public Instance Methods

context() click to toggle source
# File lib/weather_gov/feature.rb, line 20
def context
  data.fetch("@context", nil)
end
data() click to toggle source
# File lib/weather_gov/feature.rb, line 16
def data
  @data ||= @data_proc.call
end
geometry() click to toggle source
# File lib/weather_gov/feature.rb, line 32
def geometry
  data.fetch("geometry", nil)
end
id() click to toggle source
# File lib/weather_gov/feature.rb, line 24
def id
  data.fetch("id")
end
properties() click to toggle source
# File lib/weather_gov/feature.rb, line 36
def properties
  data.fetch("properties", nil)
end
type() click to toggle source
# File lib/weather_gov/feature.rb, line 28
def type
  data.fetch("type")
end