Class: RailsHmvc::Generators::OperationGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- RailsHmvc::Generators::OperationGenerator
- Includes:
- GeneratorHelpers
- Defined in:
- lib/generators/hmvc/operation/operation_generator.rb
Instance Method Summary collapse
- #create_operations ⇒ Object
-
#initialize(*args) ⇒ OperationGenerator
constructor
A new instance of OperationGenerator.
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([:type]) @operations_config = @config["operations"] set_defaults_from_config end |
Instance Method Details
#create_operations ⇒ Object
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 |