Class: NetSuite::Records::WorkOrderItemList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::TranInvt, Support::Fields
Defined in:
lib/netsuite/records/work_order_item_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

Constructor Details

#initialize(attributes = {}) ⇒ WorkOrderItemList

Returns a new instance of WorkOrderItemList.



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

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

Instance Method Details

#item=(items) ⇒ Object



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

def item=(items)
  case items
  when Hash
    self.items << WorkOrderItem.new(items)
  when Array
    items.each { |item| self.items << WorkOrderItem.new(item) }
  end
end

#itemsObject



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

def items
  @items ||= []
end

#to_recordObject



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

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