Class: NetSuite::Records::ItemFulfillmentPackageList

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

Instance Method Summary collapse

Methods included from Namespaces::TranSales

#record_namespace

Methods included from Support::Records

#record_type, #to_attributes!

Methods included from Namespaces::PlatformCore

#record_namespace

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Methods included from Support::Fields

included

Constructor Details

#initialize(attributes = {}) ⇒ ItemFulfillmentPackageList

Returns a new instance of ItemFulfillmentPackageList.



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

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

Instance Method Details

#item=(items) ⇒ Object



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

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

#itemsObject



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

def items
  @items ||= []
end

#to_recordObject



27
28
29
# File 'lib/netsuite/records/item_fulfillment_package_list.rb', line 27

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