Class: NetSuite::Records::InventoryTransferInventoryList

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

Instance Method Summary collapse

Methods included from Namespaces::TranInvt

#record_namespace

Methods included from Support::Fields

included

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Methods included from Support::Records

#record_type, #refresh, #to_attributes!

Methods included from Namespaces::PlatformCore

#record_namespace

Methods included from Support::RecordRefs

included

Constructor Details

#initialize(attributes = {}) ⇒ InventoryTransferInventoryList

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

#inventoryObject



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_recordObject



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