Sha256: e253bd2a4eca2ebc6908832901e684b0931f0fb803089798478680f4ab80a42e

Contents?: true

Size: 600 Bytes

Versions: 25

Compression:

Stored size: 600 Bytes

Contents

module JSONAPI
  class Operation
    attr_reader :resource_klass, :operation_type, :options

    def initialize(operation_type, resource_klass, options)
      @operation_type = operation_type
      @resource_klass = resource_klass
      @options = options
    end

    def transactional?
      JSONAPI::Processor._processor_from_resource_type(resource_klass).transactional_operation_type?(operation_type)
    end

    def process
      processor.process
    end

    private
    def processor
      JSONAPI::Processor.processor_instance_for(resource_klass, operation_type, options)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
jsonapi-resources-0.8.0 lib/jsonapi/operation.rb
jsonapi-resources-0.8.0.beta3 lib/jsonapi/operation.rb
jsonapi-resources-0.8.0.beta2 lib/jsonapi/operation.rb
jsonapi-resources-0.8.0.beta1 lib/jsonapi/operation.rb
jsonapi-resources-0.7.1.beta2 lib/jsonapi/operation.rb