Class: NetSuite::Records::DepositCashBackList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::TranBank, Support::Fields
Defined in:
lib/netsuite/records/deposit_cash_back_list.rb

Instance Method Summary collapse

Methods included from Namespaces::TranBank

#record_namespace

Methods included from Support::Fields

included

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Constructor Details

#initialize(attributes = {}) ⇒ DepositCashBackList

Returns a new instance of DepositCashBackList.



9
10
11
# File 'lib/netsuite/records/deposit_cash_back_list.rb', line 9

def initialize(attributes = {})
  initialize_from_attributes_hash(attributes)
end

Instance Method Details

#cashback=(cashbacks) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/netsuite/records/deposit_cash_back_list.rb', line 13

def cashback=(cashbacks)
  case cashbacks
  when Hash
    self.cashbacks << DepositCashBack.new(cashbacks)
  when Array
    cashbacks.each { |cb| self.cashbacks << DepositCashBack.new(cb) }
  end
end

#cashbacksObject



22
23
24
# File 'lib/netsuite/records/deposit_cash_back_list.rb', line 22

def cashbacks
  @cashbacks ||= []
end

#to_recordObject



26
27
28
# File 'lib/netsuite/records/deposit_cash_back_list.rb', line 26

def to_record
  { "#{record_namespace}:depositCashBack" => cashbacks.map(&:to_record) }
end