Sha256: 2dc02868c25eb0141355c13d481b8304204c7fba16a2dc9e88a5127d9af518a8

Contents?: true

Size: 636 Bytes

Versions: 37

Compression:

Stored size: 636 Bytes

Contents

module NetSuite
  module Records
    class CashRefundItemList
      include Support::Fields
      include Namespaces::TranCust

      fields :item

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

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

37 entries across 37 versions & 1 rubygems

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