Class: Rottweiler::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rottweiler/configuration.rb

Overview

‘Configuration` class allows to store and retrieve current Rottweiler configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



20
21
22
23
24
25
# File 'lib/rottweiler/configuration.rb', line 20

def initialize
  @token_header = 'Authorization'
  @token_param = [:token]
  @unauthorized_status = :unauthorized
  @jwt = Configs::JWT.new
end

Instance Attribute Details

#jwtObject (readonly)

Returns the value of attribute jwt.



18
19
20
# File 'lib/rottweiler/configuration.rb', line 18

def jwt
  @jwt
end

#token_headerObject

Returns the value of attribute token_header.



16
17
18
# File 'lib/rottweiler/configuration.rb', line 16

def token_header
  @token_header
end

#token_paramObject

Returns the value of attribute token_param.



16
17
18
# File 'lib/rottweiler/configuration.rb', line 16

def token_param
  @token_param
end

#unauthorized_statusObject

Returns the value of attribute unauthorized_status.



16
17
18
# File 'lib/rottweiler/configuration.rb', line 16

def unauthorized_status
  @unauthorized_status
end

Class Method Details

.instanceObject



8
9
10
# File 'lib/rottweiler/configuration.rb', line 8

def self.instance
  @instance ||= Configuration.new
end

.reset!Object



12
13
14
# File 'lib/rottweiler/configuration.rb', line 12

def self.reset!
  @instance = Configuration.new
end