Sha256: 07e39f09caba405b25f0246e91f05918f558b3f4de1b0b27d6c6530ed8169622

Contents?: true

Size: 885 Bytes

Versions: 15

Compression:

Stored size: 885 Bytes

Contents

# frozen_string_literal: true

require_relative '../operation'

module LedgerSync
  module NetSuite
    class Operation
      class Delete
        include NetSuite::Operation::Mixin

        private

        def delete
          case response.status
          when 200..299
            LedgerSync::Result.Success(response)
          else
            failure(
              Error::OperationError.new(
                operation: self,
                response: response
              )
            )
          end
        end

        def operate
          delete
            .and_then { success }
        end

        def response
          @response ||= client.delete(
            path: ledger_resource_path
          )
        end

        def success
          super(
            resource: resource,
            response: response
          )
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ledger_sync-netsuite-0.7.1 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.6.2 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.6.1 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.6.0 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.5.0 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.4.2 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.6 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.5 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.4 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.3 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.2 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.1 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.3.0 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.2.0 lib/ledger_sync/netsuite/operation/delete.rb
ledger_sync-netsuite-0.1.1 lib/ledger_sync/netsuite/operation/delete.rb