Module: Dps

Defined in:
lib/dps.rb,
lib/dps/dns.rb,
lib/dps/engine.rb,
lib/dps/version.rb,
app/controllers/dps/info_controller.rb,
app/controllers/dps/payments_controller.rb,
app/controllers/dps/application_controller.rb

Defined Under Namespace

Classes: ApplicationController, DNS, Engine, Error, InfoController, PaymentsController, ProcNotSetError

Constant Summary collapse

VERSION =
"0.0.9"

Class Method Summary collapse

Class Method Details

.get_new_payment_renderer(endpoint) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/dps.rb', line 19

def self.get_new_payment_renderer(endpoint)
  begin
    new_payment_endpoints_renderers.fetch(endpoint.to_sym)
  rescue KeyError
    ProcNotSetError.new("Endpoint proc not set: '#{endpoint}'")
  end
end

.new_payment_renderer(endpoint, renderer) ⇒ Object



27
28
29
30
31
32
# File 'lib/dps.rb', line 27

def self.new_payment_renderer(endpoint, renderer)
  DBC.require(!renderer.is_a?(Class), "Renderer '#{renderer}' must not be a Class for delegation to work.")
  DBC.require(renderer.is_a?(Module), "Renderer '#{renderer}' must be a Module for delegation to work.")
  
  new_payment_endpoints_renderers[endpoint.to_sym] = renderer
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Dps)

    the object that the method was called on



15
16
17
# File 'lib/dps.rb', line 15

def self.setup
  yield(self)
end