Class: Lina::Generators::ApiGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/lina/api/api_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_routesObject



13
14
15
16
17
# File 'lib/generators/lina/api/api_generator.rb', line 13

def add_routes
  actions.reverse.each do |action|
    route generate_routing_code(action)
  end
end

#create_controller_filesObject



9
10
11
# File 'lib/generators/lina/api/api_generator.rb', line 9

def create_controller_files
  template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb")
end