Sha256: e78f54a8acae05daeb9b99864700339a4cfb40cb27bef7918efe87256d75474e

Contents?: true

Size: 796 Bytes

Versions: 10

Compression:

Stored size: 796 Bytes

Contents

module NetSuite
  module Records
    class CustomerRefundDepositList
      include Support::Fields
      include Support::Records
      include Namespaces::TranCust
 
      fields :replace_all
 
      def initialize(attributes = {})
        initialize_from_attributes_hash(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
        super.merge({ "#{record_namespace}:customerRefundDeposit" => deposits.map(&:to_record) })
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
netsuite-0.3.3 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.3.2 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.3.1 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.3.0 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.6 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.5 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.4 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.3 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.2 lib/netsuite/records/customer_refund_deposit_list.rb
netsuite-0.2.1 lib/netsuite/records/customer_refund_deposit_list.rb