module SmsCandy::Authentication::Strategies

Public Class Methods

add(label, strategy = nil) click to toggle source
# File lib/sms_candy/authentication/strategies.rb, line 9
def add(label, strategy = nil)
  strategy ||= SmsCandy::Authentication::Strategies::OAuth2.new

  unless strategy.class.method_defined?(:authenticate!)
    raise NoMethodError, "authenticate! is not declared in the #{label.inspect} strategy"
  end

  _strategies[label] = strategy
end
clear!() click to toggle source
# File lib/sms_candy/authentication/strategies.rb, line 19
def clear!
  _strategies.clear
end
list() click to toggle source
# File lib/sms_candy/authentication/strategies.rb, line 23
def list
  _strategies
end

Private Class Methods

_strategies() click to toggle source
# File lib/sms_candy/authentication/strategies.rb, line 29
def _strategies
  @strategies ||= {}
end