Class: Dashing::Weather

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/dashing/weather.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#formatObject

Returns the value of attribute format.



9
10
11
# File 'lib/dashing/weather.rb', line 9

def format
  @format
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/dashing/weather.rb', line 7

def name
  @name
end

#woe_idObject

Returns the value of attribute woe_id.



8
9
10
# File 'lib/dashing/weather.rb', line 8

def woe_id
  @woe_id
end

Class Method Details

.source_rootObject



11
12
13
# File 'lib/dashing/weather.rb', line 11

def self.source_root
  File.expand_path('../../templates', __FILE__)
end

Instance Method Details

#install(type, name, woe_id, format) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/dashing/weather.rb', line 16

def install(type, name, woe_id, format)
  @name = Thor::Util.snake_case(name)
  case type
  when 'widget'      
    directory :widgets
  when 'job'
    @format = format
    @woe_id = woe_id
    directory :jobs
  else
    puts "invalid install type. Please use widget or job."
  end
end