Class: Rhoconnect::Handler::Authenticate::Runner

Inherits:
Object
  • Object
show all
Includes:
Helpers::Binding
Defined in:
lib/rhoconnect/handler/authenticate/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Binding

#bind_handler

Constructor Details

#initialize(app, route_handler, params = {}) ⇒ Runner

Returns a new instance of Runner.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
# File 'lib/rhoconnect/handler/authenticate/runner.rb', line 9

def initialize(app, route_handler, params = {})
  raise ArgumentError.new('Invalid app') unless app
  raise ArgumentError.new('Invalid authenticate handler') unless route_handler
  @app = app
  @route_handler = bind_handler(:authenricate_handler_method, route_handler)
  @params = params
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



5
6
7
# File 'lib/rhoconnect/handler/authenticate/runner.rb', line 5

def app
  @app
end

#paramsObject

Returns the value of attribute params.



5
6
7
# File 'lib/rhoconnect/handler/authenticate/runner.rb', line 5

def params
  @params
end

#route_handlerObject

Returns the value of attribute route_handler.



5
6
7
# File 'lib/rhoconnect/handler/authenticate/runner.rb', line 5

def route_handler
  @route_handler
end

Instance Method Details

#runObject



17
18
19
20
21
22
# File 'lib/rhoconnect/handler/authenticate/runner.rb', line 17

def run
    if params[:login].nil? or params[:login].empty?
      return false
    end
    user = _do_authenticate
end