Sha256: 3af742b5f6ff06043a0d2e51afe83c3d9d5b7629a9aa786d2f299e9ec52dd131

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

module Jackpot

  # A simple decorator to Active Merchant's Card.  
  # 
  class Card 
    def initialize(card_hash) 
      @component  = ActiveMerchant::Billing::CreditCard.new(HashWithIndifferentAccess.new(card_hash))
    end 

    def method_missing(meth, *args)
      if @component.respond_to?(meth)
        @component.send(meth, *args)
      else
        super
      end 
    end 

    def respond_to?(meth)
      unless @component.respond_to?(meth)
        super.respond_to? meth
      end
    end 

    def masquerade_number
      "XXXX-XXXX-XXXX-#{number.last(4)}" 
    end 

  end 
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackpot-0.0.3 app/models/jackpot/card.rb