Class: DecodeThis::Decoder
- Inherits:
-
Object
- Object
- DecodeThis::Decoder
- Defined in:
- lib/decode_this/decoder.rb
Instance Attribute Summary collapse
-
#config_file ⇒ Object
readonly
Returns the value of attribute config_file.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#header_value ⇒ Object
readonly
Returns the value of attribute header_value.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(header_value, config_file:, env:, logger: nil) ⇒ Decoder
constructor
A new instance of Decoder.
Constructor Details
#initialize(header_value, config_file:, env:, logger: nil) ⇒ Decoder
Returns a new instance of Decoder.
11 12 13 14 15 16 |
# File 'lib/decode_this/decoder.rb', line 11 def initialize(header_value, config_file:, env:, logger: nil) @header_value = header_value @config_file = config_file @env = env @logger = logger end |
Instance Attribute Details
#config_file ⇒ Object (readonly)
Returns the value of attribute config_file.
9 10 11 |
# File 'lib/decode_this/decoder.rb', line 9 def config_file @config_file end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/decode_this/decoder.rb', line 9 def env @env end |
#header_value ⇒ Object (readonly)
Returns the value of attribute header_value.
9 10 11 |
# File 'lib/decode_this/decoder.rb', line 9 def header_value @header_value end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/decode_this/decoder.rb', line 9 def logger @logger end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/decode_this/decoder.rb', line 18 def call safe_decode { JWT.decode(token, public_key, true, algorithm: algorithm).first } end |