Class: NetSuite::Records::InventoryTransferInventoryList
Instance Method Summary
collapse
#record_namespace
included
#attributes, #attributes=, #initialize_from_attributes_hash
#record_type, #to_attributes!
#record_namespace
included
Constructor Details
Returns a new instance of InventoryTransferInventoryList.
11
12
13
|
# File 'lib/netsuite/records/inventory_transfer_inventory_list.rb', line 11
def initialize(attributes = {})
initialize_from_attributes_hash(attributes)
end
|
Instance Method Details
#inventory ⇒ Object
24
25
26
|
# File 'lib/netsuite/records/inventory_transfer_inventory_list.rb', line 24
def inventory
@inventory ||= []
end
|
#inventory=(items) ⇒ Object
15
16
17
18
19
20
21
22
|
# File 'lib/netsuite/records/inventory_transfer_inventory_list.rb', line 15
def inventory=(items)
case items
when Hash
self.inventory << InventoryTransferInventory.new(items)
when Array
items.each { |item| self.inventory << InventoryTransferInventory.new(item) }
end
end
|
#to_record ⇒ Object
28
29
30
|
# File 'lib/netsuite/records/inventory_transfer_inventory_list.rb', line 28
def to_record
{ "#{record_namespace}:inventory" => inventory.map(&:to_record) }
end
|