Sha256: 60a61cc49b07bb8d70b881f0f9dd528f7b58b56656df23111ee9e29b7fc6e1e9

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

# encoding: utf-8
module SEPA
  class DirectDebitTransaction < Transaction
    attr_accessor :mandate_id, :mandate_date_of_signature

    validates_length_of :mandate_id, :within => 1..35
    validates_presence_of :mandate_date_of_signature

    validate do |t|
      if t.mandate_date_of_signature.is_a?(Date)
        errors.add(:mandate_date_of_signature, 'is in the future') if t.mandate_date_of_signature > Date.today
      else
        errors.add(:mandate_date_of_signature, 'is not a Date')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sepa_king-0.0.4 lib/sepa_king/transaction/direct_debit_transaction.rb