class SmartAlec::Weather
Public Class Methods
new(location)
click to toggle source
# File lib/smart_alec/weather.rb, line 5 def initialize(location) @weather_info = OpenWeather::Current.city(location) end
Public Instance Methods
fahrenheit()
click to toggle source
# File lib/smart_alec/weather.rb, line 13 def fahrenheit ((kelvin.to_f - 273.15) * 1.8 + 32).round(2) end
kelvin()
click to toggle source
# File lib/smart_alec/weather.rb, line 9 def kelvin @weather_info["main"]["temp"] end