Class: Redlink::Weather

Inherits:
Redthing show all
Defined in:
lib/redlink/weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Redthing

#initialize

Constructor Details

This class inherits a constructor from Redlink::Redthing

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def condition
  @condition
end

#humidityObject

Returns the value of attribute humidity.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def humidity
  @humidity
end

#is_definedObject

Returns the value of attribute is_defined.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def is_defined
  @is_defined
end

#is_validObject

Returns the value of attribute is_valid.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def is_valid
  @is_valid
end

#phrase_keyObject

Returns the value of attribute phrase_key.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def phrase_key
  @phrase_key
end

#temp_unitObject

Returns the value of attribute temp_unit.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def temp_unit
  @temp_unit
end

#temperatureObject

Returns the value of attribute temperature.



5
6
7
# File 'lib/redlink/weather.rb', line 5

def temperature
  @temperature
end

Instance Method Details

#to_sObject



7
8
9
10
11
12
13
# File 'lib/redlink/weather.rb', line 7

def to_s
  if is_defined && is_valid
    "#{temperature.to_i}° #{condition}"
  else
    ""
  end
end