Class: DryCrudJsonapiSwagger::Setup
- Inherits:
-
Object
- Object
- DryCrudJsonapiSwagger::Setup
- Defined in:
- app/domain/dry_crud_jsonapi_swagger/setup.rb
Instance Attribute Summary collapse
-
#controller_classes ⇒ Object
readonly
Returns the value of attribute controller_classes.
-
#request_uri ⇒ Object
readonly
Returns the value of attribute request_uri.
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(request_url, controller_classes) ⇒ Setup
constructor
A new instance of Setup.
- #json_api_mimetype ⇒ Object
- #run ⇒ Object
- #setup_tags(swagger_doc) ⇒ Object
Constructor Details
#initialize(request_url, controller_classes) ⇒ Setup
Returns a new instance of Setup.
5 6 7 8 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 5 def initialize(request_url, controller_classes) @request_uri = URI.parse(request_url) @controller_classes = controller_classes end |
Instance Attribute Details
#controller_classes ⇒ Object (readonly)
Returns the value of attribute controller_classes.
3 4 5 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 3 def controller_classes @controller_classes end |
#request_uri ⇒ Object (readonly)
Returns the value of attribute request_uri.
3 4 5 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 3 def request_uri @request_uri end |
Instance Method Details
#host ⇒ Object
15 16 17 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 15 def host "#{request_uri.host}:#{request_uri.port}" end |
#json_api_mimetype ⇒ Object
19 20 21 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 19 def json_api_mimetype JSONAPI::Rails::Railtie::MEDIA_TYPE end |
#run ⇒ Object
10 11 12 13 |
# File 'app/domain/dry_crud_jsonapi_swagger/setup.rb', line 10 def run swaggered_classes = [, setup_controllers, setup_models].flatten Swagger::Blocks.build_root_json(swaggered_classes) end |