Class: OpenapiBlocks::Controller
- Inherits:
-
Object
- Object
- OpenapiBlocks::Controller
- Defined in:
- lib/openapi_blocks/controller.rb
Overview
rubocop:disable Style/Documentation
Class Attribute Summary collapse
-
._operations ⇒ Object
readonly
Returns the value of attribute _operations.
-
._resource ⇒ Object
readonly
Returns the value of attribute _resource.
-
._tags ⇒ Object
readonly
Returns the value of attribute _tags.
Class Method Summary collapse
- ._associations ⇒ Object
- ._ignored ⇒ Object
- ._virtual_attributes ⇒ Object
- .model ⇒ Object
- .operation(action, &block) ⇒ Object
- .resource(klass) ⇒ Object
- .tags(*values) ⇒ Object
Class Attribute Details
._operations ⇒ Object (readonly)
Returns the value of attribute _operations.
6 7 8 |
# File 'lib/openapi_blocks/controller.rb', line 6 def _operations @_operations end |
._resource ⇒ Object (readonly)
Returns the value of attribute _resource.
6 7 8 |
# File 'lib/openapi_blocks/controller.rb', line 6 def _resource @_resource end |
._tags ⇒ Object (readonly)
Returns the value of attribute _tags.
6 7 8 |
# File 'lib/openapi_blocks/controller.rb', line 6 def @_tags end |
Class Method Details
._associations ⇒ Object
16 17 18 |
# File 'lib/openapi_blocks/controller.rb', line 16 def _associations @_resource&._associations end |
._ignored ⇒ Object
24 25 26 |
# File 'lib/openapi_blocks/controller.rb', line 24 def _ignored @_resource&._ignored end |
._virtual_attributes ⇒ Object
20 21 22 |
# File 'lib/openapi_blocks/controller.rb', line 20 def _virtual_attributes @_resource&._virtual_attributes end |
.model ⇒ Object
12 13 14 |
# File 'lib/openapi_blocks/controller.rb', line 12 def model @_resource&.model end |
.operation(action, &block) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/openapi_blocks/controller.rb', line 28 def operation(action, &block) @_operations ||= {} builder = OperationBuilder.new builder.instance_eval(&block) if block @_operations[action] = builder end |
.resource(klass) ⇒ Object
8 9 10 |
# File 'lib/openapi_blocks/controller.rb', line 8 def resource(klass) @_resource = klass end |
.tags(*values) ⇒ Object
35 36 37 |
# File 'lib/openapi_blocks/controller.rb', line 35 def (*values) values.any? ? @_tags = values : @_tags end |