Module: PowerApi::GeneratorHelper::ControllerHelper
- Extended by:
- ActiveSupport::Concern
- Included in:
- PowerApi::GeneratorHelpers
- Defined in:
- lib/power_api/generator_helper/controller_helper.rb
Overview
rubocop:disable Metrics/ModuleLength
Instance Method Summary collapse
- #api_base_controller_path ⇒ Object
- #api_base_controller_tpl ⇒ Object
- #base_controller_path ⇒ Object
- #base_controller_tpl ⇒ Object
- #resource_controller_path ⇒ Object
- #resource_controller_tpl ⇒ Object
Instance Method Details
#api_base_controller_path ⇒ Object
16 17 18 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 16 def api_base_controller_path "app/controllers/api/base_controller.rb" end |
#api_base_controller_tpl ⇒ Object
28 29 30 31 32 33 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 28 def api_base_controller_tpl " class Api::BaseController < PowerApi::BaseController\n end\n CONTROLLER\nend\n" |
#base_controller_path ⇒ Object
20 21 22 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 20 def base_controller_path "app/controllers/api/v#{version_number}/base_controller.rb" end |
#base_controller_tpl ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 35 def base_controller_tpl " class Api::V\#{version_number}::BaseController < Api::BaseController\n before_action do\n self.namespace_for_serializer = ::Api::V\#{version_number}\n end\n end\n CONTROLLER\nend\n" |
#resource_controller_path ⇒ Object
24 25 26 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 24 def resource_controller_path "app/controllers/api/v#{version_number}/#{resource.plural}_controller.rb" end |
#resource_controller_tpl ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/power_api/generator_helper/controller_helper.rb', line 45 def resource_controller_tpl tpl_class( ctrl_tpl_class_definition_line, ctrl_tpl_acts_as_token_authentication_handler, ctrl_tpl_index, ctrl_tpl_show, ctrl_tpl_create, ctrl_tpl_update, ctrl_tpl_destroy, "private", ctrl_tpl_resource, ctrl_tpl_resources_from_authenticated_resource, ctrl_tpl_find_parent_resource, ctrl_tpl_permitted_params ) end |