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



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

def controller_name
  operation_name.pluralize + 'Controller'
end

#generate_layoutObject



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

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

#operation_nameObject



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

def operation_name
  file_name.camelize
end