Class: IronBank::Authentication

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/iron_bank/authentication.rb

Overview

Get a valid token or session HTTP request header for IronBank

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Authentication

Returns a new instance of Authentication.



13
14
15
16
17
# File 'lib/iron_bank/authentication.rb', line 13

def initialize(params)
  @auth_type = params.delete(:auth_type)
  @params    = params
  create_session
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



9
10
11
# File 'lib/iron_bank/authentication.rb', line 9

def session
  @session
end

Instance Method Details

#create_sessionObject Also known as: renew_session



19
20
21
# File 'lib/iron_bank/authentication.rb', line 19

def create_session
  @session = adapter.new(**params)
end