Class: NetSuite::Records::CashSaleItemList

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

Instance Method Summary collapse

Methods included from Namespaces::TranSales

#record_namespace

Constructor Details

#initialize(attributes = {}) ⇒ CashSaleItemList

Returns a new instance of CashSaleItemList.



6
7
8
9
10
11
12
13
# File 'lib/netsuite/records/cash_sale_item_list.rb', line 6

def initialize(attributes = {})
  case attributes[:item]
  when Hash
    items << CashSaleItem.new(attributes[:item])
  when Array
    attributes[:item].each { |item| items << CashSaleItem.new(item) }
  end
end

Instance Method Details

#itemsObject



15
16
17
# File 'lib/netsuite/records/cash_sale_item_list.rb', line 15

def items
  @items ||= []
end

#to_recordObject



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

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