Class: Jackpot::Gateway
- Inherits:
-
Object
- Object
- Jackpot::Gateway
- Defined in:
- app/models/jackpot/gateway.rb
Overview
Small adapter for Active Merchant gateways Jackpot supports
Instance Method Summary collapse
-
#capture(money, authorization, options = {}) ⇒ Object
TODO: Remove this ugly hack and move to a lighterweight PORO decorator approach.
-
#initialize(gateway) ⇒ Gateway
constructor
A new instance of Gateway.
- #method_missing(meth, *args) ⇒ Object
- #respond_to?(meth) ⇒ Boolean
Constructor Details
#initialize(gateway) ⇒ Gateway
Returns a new instance of Gateway.
6 7 8 |
# File 'app/models/jackpot/gateway.rb', line 6 def initialize(gateway) @gateway = gateway end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/models/jackpot/gateway.rb', line 10 def method_missing(meth, *args) if @gateway.respond_to?(meth) @gateway.send(meth, *args) else super end end |
Instance Method Details
#capture(money, authorization, options = {}) ⇒ Object
TODO: Remove this ugly hack and move to a lighterweight PORO decorator approach
19 20 21 |
# File 'app/models/jackpot/gateway.rb', line 19 def capture(money, , = {}) @gateway.capture(money, , ) end |
#respond_to?(meth) ⇒ Boolean
23 24 25 |
# File 'app/models/jackpot/gateway.rb', line 23 def respond_to?(meth) @gateway.respond_to?(meth) end |