Class: DryCrudJsonapiSwagger::ControllerSetup
- Inherits:
-
Object
- Object
- DryCrudJsonapiSwagger::ControllerSetup
show all
- Includes:
- Helper
- Defined in:
- app/domain/dry_crud_jsonapi_swagger/controller_setup.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Helper
#controller_route, #human_name, #include_description, #includes, #model_name, #nested_controller_id, #nested_human_name, #nested_model_name, #nested_root_path, #parameter_custom, #parameter_id, #parameter_include, #parameters, #path_spec, #response_schema, #setup_swagger_path, #setup_tag
Constructor Details
#initialize(controller_class) ⇒ ControllerSetup
Returns a new instance of ControllerSetup.
7
8
9
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 7
def initialize(controller_class)
@controller_class = controller_class
end
|
Instance Attribute Details
#controller_class ⇒ Object
Returns the value of attribute controller_class.
5
6
7
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 5
def controller_class
@controller_class
end
|
Instance Method Details
#index_path ⇒ Object
32
33
34
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 32
def index_path
polymorphic_path(model_name.route_key) rescue nil
end
|
#run ⇒ Object
11
12
13
14
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 11
def run
setup_index_path
setup_show_path
end
|
#setup_index_path ⇒ Object
16
17
18
19
20
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 16
def setup_index_path
setup_swagger_path(index_path) do |helper|
helper.path_spec(self, helper, :index)
end
end
|
#setup_show_path ⇒ Object
22
23
24
25
26
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 22
def setup_show_path
setup_swagger_path(show_path) do |helper|
helper.path_spec(self, helper, :show)
end
end
|
#show_path ⇒ Object
28
29
30
|
# File 'app/domain/dry_crud_jsonapi_swagger/controller_setup.rb', line 28
def show_path
polymorphic_path(model_name.singular_route_key, id: 1) rescue nil
end
|