Sha256: ba59ce00ed4f0dfe6e99bf89e1d8692de3c3f5a8fedc30a00599b60df09f7f98

Contents?: true

Size: 989 Bytes

Versions: 8

Compression:

Stored size: 989 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Ledgers
    module NetSuite
      class Operation
        module Mixin
          def self.included(base)
            base.include Ledgers::Operation::Mixin
            base.include InstanceMethods # To ensure these override parent methods
          end

          module InstanceMethods
            def request_params
              {}
            end

            def ledger_id
              @ledger_id ||= Util::URLHelpers.id_from_url(url: response.headers['Location'])
            end

            def ledger_resource_path(args = {})
              client.ledger_resource_path(
                {
                  resource: resource
                }.merge(
                  args.merge(
                    params: request_params.merge(
                      args.fetch(:params, {})
                    )
                  )
                )
              )
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.4.4 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/netsuite/operation.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/netsuite/operation.rb