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.5.1 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.5.0 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.9 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.8 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.7 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.6 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.5 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.4 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.3 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.2 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.1 lib/netsuite/records/customer_refund_apply_list.rb
netsuite-0.4.0 lib/netsuite/records/customer_refund_apply_list.rb