Class: Thundersnow::Bin

Inherits:
Object
  • Object
show all
Defined in:
lib/thundersnow/bin.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Bin

Returns a new instance of Bin.



4
5
6
# File 'lib/thundersnow/bin.rb', line 4

def initialize(args)
  @args = args
end

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/thundersnow/bin.rb', line 8

def run
  @weather = Weather.new(location)

  return "Could not locate weather for #{location}" unless @weather.valid?

  if show_forecast?
    show :forecast
  else
    show :current
  end
end