Class: OAuth::Controllers::ApplicationControllerMethods::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth/controllers/application_controller_methods.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Filter

Returns a new instance of Filter.



22
23
24
25
26
27
28
29
# File 'lib/oauth/controllers/application_controller_methods.rb', line 22

def initialize(options={})
  @options={
      :interactive=>true,
      :strategies => [:token,:two_legged]
    }.merge(options)
  @strategies = Array(@options[:strategies])
  @strategies << :interactive if @options[:interactive]
end

Instance Method Details

#filter(controller) ⇒ Object



31
32
33
# File 'lib/oauth/controllers/application_controller_methods.rb', line 31

def filter(controller)
  Authenticator.new(controller,@strategies).allow?
end