class Dialers::ShortCircuit

Attributes

action[RW]
condition[RW]

Public Class Methods

new(condition, action) click to toggle source
# File lib/dialers/short_circuit.rb, line 3
def initialize(condition, action)
  self.condition = condition
  self.action = action
end

Public Instance Methods

can_stop?(response) click to toggle source
# File lib/dialers/short_circuit.rb, line 8
def can_stop?(response)
  condition.call(response)
end
stop(response) click to toggle source
# File lib/dialers/short_circuit.rb, line 12
def stop(response)
  action.call(response)
end