Class: RailsHmvc::Generators::OperationGenerator

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

Instance Method Summary collapse

Methods included from GeneratorHelpers

#load_config, #load_config_for_type, #namespace_name, #namespace_path, #singular_human_name

Constructor Details

#initialize(*args) ⇒ OperationGenerator

Returns a new instance of OperationGenerator.



15
16
17
18
19
20
# File 'lib/generators/hmvc/operation/operation_generator.rb', line 15

def initialize(*args)
  super
  @config = load_config_for_type(options[:type])
  @operations_config = @config["operations"]
  set_defaults_from_config
end

Instance Method Details

#create_operationsObject



22
23
24
25
26
27
28
# File 'lib/generators/hmvc/operation/operation_generator.rb', line 22

def create_operations
  return create_single_operation if actions.empty?

  actions.each do |action|
    create_operation_for(action)
  end
end