Sha256: 7f89e4e1c61dc0e11a0eec5b0fc3e87891a850933d651cb58271c8bb62c15af5

Contents?: true

Size: 712 Bytes

Versions: 27

Compression:

Stored size: 712 Bytes

Contents

module NetSuite
  module Records
    class CustomerRefundDepositList
      include Support::Records
      include Namespaces::TranCust

      def initialize(attributes = {})
        case attributes[:customer_refund_deposit]
        when Hash
          deposits << CustomerRefundDeposit.new(attributes[:customer_refund_deposit])
        when Array
          attributes[:customer_refund_deposit].each { |deposit| deposits << CustomerRefundDeposit.new(deposit) }
        end
      end

      def deposits
        @deposits ||= []
      end

      def to_record
        deposits.map do |deposit|
          { "#{record_namespace}:customerRefundDeposit" => deposit.to_record }
        end
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
netsuite-0.2.0 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.1.0 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.50 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.49 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.48 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.47 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.45 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.44 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.43 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.42 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.41 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.40 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.39 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.38 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.37 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.36 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.35 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.34 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.33 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.0.32 lib/netsuite/records/customer_refund_deposit_list.rb