Sha256: 4543983e362ee2b2f6b693e3c9e58a8f6978b78de12c3a67d04711cce78295bd

Contents?: true

Size: 423 Bytes

Versions: 23

Compression:

Stored size: 423 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  class Operation
    %i[
      create
      update
      patch
      find
      delete
    ].each do |method|
      define_singleton_method(method) do |args = {}|
        operation_for(args.merge(method: method))
      end
    end

    def self.operation_for(args = {})
      client = args.fetch(:client)

      client.operation_for(args.except(:client))
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ledger_sync-3.0.0 lib/ledger_sync/operation.rb
ledger_sync-2.6.0 lib/ledger_sync/operation.rb
ledger_sync-2.5.0 lib/ledger_sync/operation.rb
ledger_sync-2.4.4 lib/ledger_sync/operation.rb
ledger_sync-2.3.1 lib/ledger_sync/operation.rb
ledger_sync-2.2.3 lib/ledger_sync/operation.rb
ledger_sync-2.2.1 lib/ledger_sync/operation.rb
ledger_sync-2.2.0 lib/ledger_sync/operation.rb
ledger_sync-2.0.2 lib/ledger_sync/operation.rb
ledger_sync-2.0.1 lib/ledger_sync/operation.rb
ledger_sync-2.0.0 lib/ledger_sync/operation.rb
ledger_sync-2.0.0.pre.1 lib/ledger_sync/operation.rb
ledger_sync-1.8.1 lib/ledger_sync/operation.rb
ledger_sync-1.8.0 lib/ledger_sync/operation.rb
ledger_sync-1.7.0 lib/ledger_sync/operation.rb
ledger_sync-1.6.0 lib/ledger_sync/operation.rb
ledger_sync-1.5.2 lib/ledger_sync/operation.rb
ledger_sync-1.5.1 lib/ledger_sync/operation.rb
ledger_sync-1.5.0 lib/ledger_sync/operation.rb
ledger_sync-1.4.4 lib/ledger_sync/operation.rb