Sha256: adf29585ea465d573f3730759267bb2bed9901346123b991fcb93095205ccbf1

Contents?: true

Size: 726 Bytes

Versions: 32

Compression:

Stored size: 726 Bytes

Contents

module NetSuite
  module Records
    class CustomerRefundApplyList
      include Namespaces::TranCust

      # TODO should use new sublist implementation

      attr_accessor :replace_all

      def initialize(attributes = {})
        case attributes[:apply]
        when Hash
          applies << CustomerRefundApply.new(attributes[:apply])
        when Array
          attributes[:apply].each { |apply| applies << CustomerRefundApply.new(apply) }
        end
      end

      def applies
        @applies ||= []
      end

      def to_record
        rec = { "#{record_namespace}:apply" => applies.map(&:to_record) }
        rec[:@replaceAll] = @replace_all unless @replace_all.nil?
        rec
      end

    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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