Class: Sundown::Weather

Inherits:
Object
  • Object
show all
Defined in:
lib/sundown/weather.rb

Overview

Used to get weather information without caching, fire queries everytime.

Class Method Summary collapse

Class Method Details

.temperature(location, degree = 'f') ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/sundown/weather.rb', line 9

def self.temperature(location, degree = 'f')
  location = Location.new(location)
  if degree == 'f'
    location.temperature
  else
    location.temperature('c')
  end
end

.timestamp(location) ⇒ Object



18
19
20
21
# File 'lib/sundown/weather.rb', line 18

def self.timestamp(location)
  location = Location.new(location)
  location.timestamp
end