Sha256: 75bdd622e106fd2c6aa9fa912d20159d8a47100249064df3dc4e5a85ac70c672
Contents?: true
Size: 674 Bytes
Versions: 3
Compression:
Stored size: 674 Bytes
Contents
require 'delegate' module Barometer module WeatherService class ForecastIo class Query < SimpleDelegator attr_reader :converted_query def self.accepted_formats [:coordinates] end def initialize(query) super @converted_query = convert_query end def to_param @converted_query.q end def units_param {units: unit_type} end private def convert_query convert!(*self.class.accepted_formats) end def unit_type converted_query.metric? ? 'si' : 'us' end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems