Class: Doorkeeper::JWT::Config::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/jwt/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Builder

Returns a new instance of Builder.



21
22
23
24
# File 'lib/doorkeeper/jwt/config.rb', line 21

def initialize(&block)
  @config = Config.new
  instance_eval(&block)
end

Instance Method Details

#buildObject



26
27
28
# File 'lib/doorkeeper/jwt/config.rb', line 26

def build
  @config
end

#encryption_method(value) ⇒ Object

For backward compatibility. This library does not support encryption.



43
44
45
46
# File 'lib/doorkeeper/jwt/config.rb', line 43

def encryption_method(value)
  @config.instance_variable_set("@signing_method", value)
  Kernel.warn("[DOORKEEPER-JWT]: Please use signing_method instead, this option is deprecated and will be removed soon")
end

#secret_key(value) ⇒ Object



34
35
36
# File 'lib/doorkeeper/jwt/config.rb', line 34

def secret_key(value)
  @config.instance_variable_set("@secret_key", value)
end

#secret_key_path(value) ⇒ Object



38
39
40
# File 'lib/doorkeeper/jwt/config.rb', line 38

def secret_key_path(value)
  @config.instance_variable_set("@secret_key_path", value)
end

#signing_method(value) ⇒ Object



48
49
50
# File 'lib/doorkeeper/jwt/config.rb', line 48

def signing_method(value)
  @config.instance_variable_set("@signing_method", value)
end

#use_application_secret(value) ⇒ Object



30
31
32
# File 'lib/doorkeeper/jwt/config.rb', line 30

def use_application_secret(value)
  @config.instance_variable_set("@use_application_secret", value)
end