Class: JSONAPI::Operation
- Inherits:
-
Object
- Object
- JSONAPI::Operation
- Defined in:
- lib/jsonapi/operation.rb
Instance Attribute Summary collapse
-
#operation_type ⇒ Object
readonly
Returns the value of attribute operation_type.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#resource_klass ⇒ Object
readonly
Returns the value of attribute resource_klass.
Instance Method Summary collapse
-
#initialize(operation_type, resource_klass, options) ⇒ Operation
constructor
A new instance of Operation.
- #process ⇒ Object
- #transactional? ⇒ Boolean
Constructor Details
#initialize(operation_type, resource_klass, options) ⇒ Operation
Returns a new instance of Operation.
5 6 7 8 9 |
# File 'lib/jsonapi/operation.rb', line 5 def initialize(operation_type, resource_klass, ) @operation_type = operation_type @resource_klass = resource_klass @options = end |
Instance Attribute Details
#operation_type ⇒ Object (readonly)
Returns the value of attribute operation_type.
3 4 5 |
# File 'lib/jsonapi/operation.rb', line 3 def operation_type @operation_type end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/jsonapi/operation.rb', line 3 def @options end |
#resource_klass ⇒ Object (readonly)
Returns the value of attribute resource_klass.
3 4 5 |
# File 'lib/jsonapi/operation.rb', line 3 def resource_klass @resource_klass end |
Instance Method Details
#process ⇒ Object
15 16 17 |
# File 'lib/jsonapi/operation.rb', line 15 def process processor.process end |
#transactional? ⇒ Boolean
11 12 13 |
# File 'lib/jsonapi/operation.rb', line 11 def transactional? JSONAPI::Processor._processor_from_resource_type(resource_klass).transactional_operation_type?(operation_type) end |