Class: NetSuite::Records::CustomerRefundDepositList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::TranCust, Support::Fields, Support::Records
Defined in:
lib/netsuite/records/customer_refund_deposit_list.rb

Instance Method Summary collapse

Methods included from Namespaces::TranCust

#record_namespace

Methods included from Support::Records

#record_type, #to_attributes!

Methods included from Namespaces::PlatformCore

#record_namespace

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Methods included from Support::Fields

included

Constructor Details

#initialize(attributes = {}) ⇒ CustomerRefundDepositList

Returns a new instance of CustomerRefundDepositList.



10
11
12
13
14
15
16
17
18
# File 'lib/netsuite/records/customer_refund_deposit_list.rb', line 10

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

Instance Method Details

#depositsObject



20
21
22
# File 'lib/netsuite/records/customer_refund_deposit_list.rb', line 20

def deposits
  @deposits ||= []
end

#to_recordObject



24
25
26
# File 'lib/netsuite/records/customer_refund_deposit_list.rb', line 24

def to_record
  super.merge({ "#{record_namespace}:customerRefundDeposit" => deposits.map(&:to_record) })
end