Class: NetSuite::Records::CustomerRefundApplyList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::TranCust
Defined in:
lib/netsuite/records/customer_refund_apply_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Namespaces::TranCust

#record_namespace

Constructor Details

#initialize(attributes = {}) ⇒ CustomerRefundApplyList

Returns a new instance of CustomerRefundApplyList.



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

def initialize(attributes = {})
  case attributes[:apply]
  when Hash
    applies << CustomerRefundApply.new(attributes[:apply])
  when Array
    attributes[:apply].each { |apply| applies << CustomerRefundApply.new(apply) }
  end
end

Instance Attribute Details

#replace_allObject

TODO should use new sublist implementation



8
9
10
# File 'lib/netsuite/records/customer_refund_apply_list.rb', line 8

def replace_all
  @replace_all
end

Instance Method Details

#appliesObject



19
20
21
# File 'lib/netsuite/records/customer_refund_apply_list.rb', line 19

def applies
  @applies ||= []
end

#to_recordObject



23
24
25
26
27
# File 'lib/netsuite/records/customer_refund_apply_list.rb', line 23

def to_record
  rec = { "#{record_namespace}:apply" => applies.map(&:to_record) }
  rec[:@replaceAll] = @replace_all unless @replace_all.nil?
  rec
end