class TrailblazerGen::OperationGenerator
Public Instance Methods
create_operation_files()
click to toggle source
# File lib/trailblazer_gen/generators/operation_generator.rb, line 16 def create_operation_files @module_name = name trailblazer_path = 'app/concepts/' module_path = "#{trailblazer_path}#{@module_name.underscore}/" operation_path = "#{module_path}operation/" operations.each do |operation| @single_contract = options[:'single-contract'] @operation = operation.camelize operation_file = "#{operation_path}#{operation.underscore}.rb" template 'operation_template.rb', operation_file contract_file = if @single_contract "#{module_path}/contract.rb" else "#{module_path}contract/#{operation.underscore}.rb" end template 'contract_template.rb', contract_file end end