Sha256: c8026416b5d739b274da1c582ed76b8ce20eec8a03a85062b865e4d74120a49c

Contents?: true

Size: 770 Bytes

Versions: 36

Compression:

Stored size: 770 Bytes

Contents

module NetSuite
  module Records
    class InventoryTransferInventoryList
      include Support::RecordRefs
      include Support::Records
      include Support::Fields
      include Namespaces::TranInvt

      fields :inventory

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

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

      def inventory
        @inventory ||= []
      end

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
netsuite-0.7.1 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.7.0 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.9 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.8 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.7 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.6 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.5 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.4 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.3 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.2 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.1 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.6.0 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.9 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.8 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.7 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.6 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.5 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.4 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.3 lib/netsuite/records/inventory_transfer_inventory_list.rb
netsuite-0.5.2 lib/netsuite/records/inventory_transfer_inventory_list.rb