Class: Jazz::Generators::Controller

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jazz/generators/controller/controller.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/jazz/generators/controller/controller.rb', line 6

def name
  @name
end

Class Method Details

.source_rootObject



8
9
10
# File 'lib/jazz/generators/controller/controller.rb', line 8

def self.source_root
  File.join(File.dirname(__FILE__))
end

Instance Method Details

#createObject



12
13
14
# File 'lib/jazz/generators/controller/controller.rb', line 12

def create
  create_controller
end

#create_controllerObject



16
17
18
# File 'lib/jazz/generators/controller/controller.rb', line 16

def create_controller
  template  "templates/controller.js", "app/controllers/#{name.downcase.pluralize}_controller.js"
end