Sha256: b2a007de05b78a00b92a022e5954ba09f1620818ea5a77b17a4602615a31bf9d

Contents?: true

Size: 635 Bytes

Versions: 15

Compression:

Stored size: 635 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

15 entries across 15 versions & 1 rubygems

Version Path
netsuite-0.5.4 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.5.3 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.5.2 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.5.1 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.5.0 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.9 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.8 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.7 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.6 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.5 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.4 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.3 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.2 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.1 lib/netsuite/records/sales_order_item_list.rb
netsuite-0.4.0 lib/netsuite/records/sales_order_item_list.rb