Sha256: 8037f2985d8eefc88d06ba3f92f122f31610a2e117dcf0397ab4a3b67e82b3db

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 Bytes

Contents

module NetSuite
  module Records
    class ItemFulfillmentItemList
      include Support::Fields
      include Namespaces::TranSales

      fields :item

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

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

      def items
        @items ||= []
      end

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

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
netsuite-0.2.6 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.5 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.4 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.3 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.2 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.1 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.2.0 lib/netsuite/records/item_fulfillment_item_list.rb
netsuite-0.1.0 lib/netsuite/records/item_fulfillment_item_list.rb