Sha256: b0adb24e6b36e2307ac9bb4582a08fbcfd33edf4fbe7693ff3de21163f6cdc9d
Contents?: true
Size: 1.31 KB
Versions: 4
Compression:
Stored size: 1.31 KB
Contents
module JSONAPI class OperationResult attr_accessor :code attr_accessor :meta attr_accessor :links attr_accessor :options def initialize(code, options = {}) @code = code @options = options @meta = options.fetch(:meta, {}) @links = options.fetch(:links, {}) end end class ErrorsOperationResult < OperationResult attr_accessor :errors def initialize(code, errors, options = {}) @errors = errors super(code, options) end end class ResourceOperationResult < OperationResult attr_accessor :resource def initialize(code, resource, options = {}) @resource = resource super(code, options) end end class ResourcesOperationResult < OperationResult attr_accessor :resources, :pagination_params, :record_count def initialize(code, resources, options = {}) @resources = resources @pagination_params = options.fetch(:pagination_params, {}) @record_count = options[:record_count] super(code, options) end end class LinksObjectOperationResult < OperationResult attr_accessor :parent_resource, :association def initialize(code, parent_resource, association, options = {}) @parent_resource = parent_resource @association = association super(code, options) end end end
Version data entries
4 entries across 4 versions & 1 rubygems