class Barometer::ForecastIo::Query
Attributes
converted_query[R]
Public Class Methods
accepted_formats()
click to toggle source
# File lib/barometer/forecast_io/query.rb, line 8 def self.accepted_formats [:coordinates] end
new(query)
click to toggle source
Calls superclass method
# File lib/barometer/forecast_io/query.rb, line 12 def initialize(query) super @converted_query = convert_query end
Public Instance Methods
to_param()
click to toggle source
# File lib/barometer/forecast_io/query.rb, line 17 def to_param @converted_query.q end
units_param()
click to toggle source
# File lib/barometer/forecast_io/query.rb, line 21 def units_param {units: unit_type} end
Private Instance Methods
convert_query()
click to toggle source
# File lib/barometer/forecast_io/query.rb, line 27 def convert_query convert!(*self.class.accepted_formats) end
unit_type()
click to toggle source
# File lib/barometer/forecast_io/query.rb, line 31 def unit_type converted_query.metric? ? 'si' : 'us' end