Class: Barometer::ConvertedQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(q, format, units = :metric, geo = nil) ⇒ ConvertedQuery

Returns a new instance of ConvertedQuery



10
11
12
13
14
15
# File 'lib/barometer/query.rb', line 10

def initialize(q, format, units=:metric, geo=nil)
  @q = q
  @format = format
  @units = units
  @geo = geo
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format



8
9
10
# File 'lib/barometer/query.rb', line 8

def format
  @format
end

#geoObject (readonly)

Returns the value of attribute geo



8
9
10
# File 'lib/barometer/query.rb', line 8

def geo
  @geo
end

#qObject (readonly)

Returns the value of attribute q



8
9
10
# File 'lib/barometer/query.rb', line 8

def q
  @q
end

#unitsObject (readonly)

Returns the value of attribute units



8
9
10
# File 'lib/barometer/query.rb', line 8

def units
  @units
end

Instance Method Details

#metric?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/barometer/query.rb', line 17

def metric?
  units == :metric
end

#to_sObject



21
22
23
# File 'lib/barometer/query.rb', line 21

def to_s
  @q
end