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.9.12 lib/jsonapi/operation.rb
jsonapi-resources-0.9.11 lib/jsonapi/operation.rb
jsonapi-resources-0.9.10 lib/jsonapi/operation.rb
jsonapi-resources-0.9.9 lib/jsonapi/operation.rb
jsonapi-resources-0.9.8 lib/jsonapi/operation.rb
jsonapi-resources-0.9.7 lib/jsonapi/operation.rb
jsonapi-resources-0.9.6 lib/jsonapi/operation.rb
jsonapi-resources-0.9.5 lib/jsonapi/operation.rb
jsonapi-resources-0.9.4 lib/jsonapi/operation.rb
jsonapi-resources-0.9.3 lib/jsonapi/operation.rb
jsonapi-resources-0.9.2 lib/jsonapi/operation.rb
jsonapi-resources-0.9.1.beta2 lib/jsonapi/operation.rb
jsonapi-resources-0.9.1.beta1 lib/jsonapi/operation.rb
jsonapi-resources-0.9.0 lib/jsonapi/operation.rb
jsonapi-resources-0.9.0.beta3 lib/jsonapi/operation.rb
jsonapi-resources-0.8.3 lib/jsonapi/operation.rb
jsonapi-resources-0.8.2 lib/jsonapi/operation.rb
jsonapi-resources-0.9.0.beta2 lib/jsonapi/operation.rb
jsonapi-resources-0.9.0.beta1 lib/jsonapi/operation.rb
jsonapi-resources-0.8.1 lib/jsonapi/operation.rb