Class: JSONAPI::OperationResult
- Inherits:
-
Object
- Object
- JSONAPI::OperationResult
- Defined in:
- lib/jsonapi/operation_result.rb
Direct Known Subclasses
ErrorsOperationResult, RelationshipOperationResult, ResourceSetOperationResult, ResourcesSetOperationResult
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#links ⇒ Object
Returns the value of attribute links.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#options ⇒ Object
Returns the value of attribute options.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(code, options = {}) ⇒ OperationResult
constructor
A new instance of OperationResult.
- #to_hash(serializer = nil) ⇒ Object
Constructor Details
#initialize(code, options = {}) ⇒ OperationResult
Returns a new instance of OperationResult.
9 10 11 12 13 14 15 |
# File 'lib/jsonapi/operation_result.rb', line 9 def initialize(code, = {}) @code = Rack::Utils.status_code(code) @options = @meta = .fetch(:meta, {}) @links = .fetch(:links, {}) @warnings = .fetch(:warnings, {}) end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/jsonapi/operation_result.rb', line 3 def code @code end |
#links ⇒ Object
Returns the value of attribute links.
5 6 7 |
# File 'lib/jsonapi/operation_result.rb', line 5 def links @links end |
#meta ⇒ Object
Returns the value of attribute meta.
4 5 6 |
# File 'lib/jsonapi/operation_result.rb', line 4 def @meta end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/jsonapi/operation_result.rb', line 6 def @options end |
#warnings ⇒ Object
Returns the value of attribute warnings.
7 8 9 |
# File 'lib/jsonapi/operation_result.rb', line 7 def warnings @warnings end |
Instance Method Details
#to_hash(serializer = nil) ⇒ Object
17 18 19 |
# File 'lib/jsonapi/operation_result.rb', line 17 def to_hash(serializer = nil) {} end |