Sha256: a0a8ab58571f3f258a04c747531e55fabf3128ac29358cfaa2a9f09802680d7e

Contents?: true

Size: 636 Bytes

Versions: 14

Compression:

Stored size: 636 Bytes

Contents

module NetSuite
  module Records
    class SalesOrderItemList
      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 << SalesOrderItem.new(items)
        when Array
          items.each { |item| self.items << SalesOrderItem.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

14 entries across 14 versions & 1 rubygems

Version Path
netsuite-0.3.3 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.3.2 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.3.1 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.3.0 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.6 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.5 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.4 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.3 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.2 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.1 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.2.0 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.1.0 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.0.50 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.0.49 lib/netsuite/records/sales_order_item_list.rb