Class: ActiveMerchant::Billing::CreditCard::ExpiryMonth

Inherits:
Fixnum
  • Object
show all
Defined in:
lib/active_merchant/billing/credit_card.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#to_s(format = :default) ⇒ Object

:nodoc:



21
22
23
24
25
26
27
28
29
30
# File 'lib/active_merchant/billing/credit_card.rb', line 21

def to_s(format = :default) #:nodoc:
  case format
  when :default
    __getobj__.to_s
  when :two_digit
    sprintf("%.2i", self)[-2..-1]
  else
    super
  end  
end

#valid?Boolean

:nodoc:

Returns:

  • (Boolean)


32
33
34
# File 'lib/active_merchant/billing/credit_card.rb', line 32

def valid? #:nodoc:
  (1..12).include?(self)
end