Class: OperationGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/operation/operation_generator.rb

Instance Method Summary collapse

Instance Method Details

#controller_nameObject



13
14
15
# File 'lib/generators/operation/operation_generator.rb', line 13

def controller_name
  operation_name.pluralize + 'Controller'
end

#generate_layoutObject



5
6
7
# File 'lib/generators/operation/operation_generator.rb', line 5

def generate_layout
  template 'operation.rb.erb', File.join('app/operations', class_path, "#{file_name}_operations.rb")
end

#operation_nameObject



9
10
11
# File 'lib/generators/operation/operation_generator.rb', line 9

def operation_name
  file_name.camelize
end