Class: Merb::Generators::ControllerGenerator

Inherits:
ComponentGenerator show all
Defined in:
lib/merb-gen/controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generator

#initialize, #with_modules

Constructor Details

This class inherits a constructor from Merb::Generators::Generator

Class Method Details

.source_rootObject



5
6
7
# File 'lib/merb-gen/controller.rb', line 5

def self.source_root
  File.join(super, 'controller')
end

Instance Method Details

#controller_class_nameObject



43
44
45
# File 'lib/merb-gen/controller.rb', line 43

def controller_class_name
  chunks.last
end

#controller_modulesObject



39
40
41
# File 'lib/merb-gen/controller.rb', line 39

def controller_modules
  chunks[0..-2]
end

#file_nameObject



55
56
57
# File 'lib/merb-gen/controller.rb', line 55

def file_name
  controller_class_name.snake_case
end

#full_class_nameObject



47
48
49
# File 'lib/merb-gen/controller.rb', line 47

def full_class_name
  chunks.join('::')
end

#test_class_nameObject



51
52
53
# File 'lib/merb-gen/controller.rb', line 51

def test_class_name
  controller_class_name + "Test"
end