Sha256: 95b5c737d49bdbf9a17009c33dd529a60438439bd83c0599f6f0817c8b4f8f27

Contents?: true

Size: 631 Bytes

Versions: 36

Compression:

Stored size: 631 Bytes

Contents

module NetSuite
  module Records
    class WorkOrderItemList
      include Support::Fields
      include Namespaces::TranInvt

      fields :item

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

      def item=(items)
        case items
        when Hash
          self.items << WorkOrderItem.new(items)
        when Array
          items.each { |item| self.items << WorkOrderItem.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

36 entries across 36 versions & 1 rubygems

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