Class: NetSuite::Records::InventoryAssignmentList

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

Instance Method Summary collapse

Methods included from Namespaces::PlatformCommon

#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

Constructor Details

#initialize(attrs = {}) ⇒ InventoryAssignmentList

Returns a new instance of InventoryAssignmentList.



10
11
12
# File 'lib/netsuite/records/inventory_assignment_list.rb', line 10

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

Instance Method Details

#inventory_assignmentObject



23
24
25
# File 'lib/netsuite/records/inventory_assignment_list.rb', line 23

def inventory_assignment
  @inventory_assignment ||= []
end

#inventory_assignment=(items) ⇒ Object



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

def inventory_assignment=(items)
  case items
  when Hash
    self.inventory_assignment << InventoryAssignment.new(items)
  when Array
    items.each { |ref| self.inventory_assignment << InventoryAssignment.new(ref) }
  end
end

#to_recordObject



27
28
29
30
31
# File 'lib/netsuite/records/inventory_assignment_list.rb', line 27

def to_record
  rec = { "#{record_namespace}:inventoryAssignment" => inventory_assignment.map(&:to_record) }
  rec[:@replaceAll] = self.replace_all if !self.replace_all.nil?
  rec
end