Class: JSONAPI::ResourcesOperationResult

Inherits:
OperationResult show all
Defined in:
lib/jsonapi/operation_result.rb

Direct Known Subclasses

RelatedResourcesOperationResult

Instance Attribute Summary collapse

Attributes inherited from OperationResult

#code, #links, #meta, #options

Instance Method Summary collapse

Constructor Details

#initialize(code, resources, options = {}) ⇒ ResourcesOperationResult

Returns a new instance of ResourcesOperationResult


37
38
39
40
41
42
43
# File 'lib/jsonapi/operation_result.rb', line 37

def initialize(code, resources, options = {})
  @resources = resources
  @pagination_params = options.fetch(:pagination_params, {})
  @record_count = options[:record_count]
  @page_count = options[:page_count]
  super(code, options)
end

Instance Attribute Details

#page_countObject

Returns the value of attribute page_count


35
36
37
# File 'lib/jsonapi/operation_result.rb', line 35

def page_count
  @page_count
end

#pagination_paramsObject

Returns the value of attribute pagination_params


35
36
37
# File 'lib/jsonapi/operation_result.rb', line 35

def pagination_params
  @pagination_params
end

#record_countObject

Returns the value of attribute record_count


35
36
37
# File 'lib/jsonapi/operation_result.rb', line 35

def record_count
  @record_count
end

#resourcesObject

Returns the value of attribute resources


35
36
37
# File 'lib/jsonapi/operation_result.rb', line 35

def resources
  @resources
end