Class: Interage::Request::Generators::CreateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/interage/request/create/create_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(args, *_options) ⇒ CreateGenerator

Returns a new instance of CreateGenerator.



11
12
13
14
15
16
17
# File 'lib/generators/interage/request/create/create_generator.rb', line 11

def initialize(args, *_options)
  super

  @tab = '  '
  @arguments = args
  @request_param = arguments.shift.to_s.underscore
end

Instance Method Details

#create_requestObject



19
20
21
22
23
24
25
26
27
# File 'lib/generators/interage/request/create/create_generator.rb', line 19

def create_request
  if create_base_request?
    template('base_request.rb', new_base_request_file)
  end

  template('request.rb', new_request_file)

  template('builder.rb', new_builder_file)
end