Class: EorzeaWeather::Zone

Inherits:
Struct
  • Object
show all
Defined in:
lib/eorzea_weather/zone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/eorzea_weather/zone.rb', line 2

def id
  @id
end

#ratesObject

Returns the value of attribute rates

Returns:

  • (Object)

    the current value of rates



2
3
4
# File 'lib/eorzea_weather/zone.rb', line 2

def rates
  @rates
end

Instance Method Details

#find_rate(rate) ⇒ Object



3
4
5
# File 'lib/eorzea_weather/zone.rb', line 3

def find_rate(rate)
  rates.find { |(threshold, _weather)| threshold.nil? || rate < threshold }[1]
end