Class: Rottweiler::Auth::Result

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

Overview

Implements the logic for JWT token parsing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ Result

Returns a new instance of Result.



11
12
13
14
15
16
17
18
# File 'lib/rottweiler/auth/result.rb', line 11

def initialize(request)
  @request = request
  @data = nil
  @errors = []

  check_decode_key!
  verify! if errors.empty?
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



9
10
11
# File 'lib/rottweiler/auth/result.rb', line 9

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



9
10
11
# File 'lib/rottweiler/auth/result.rb', line 9

def errors
  @errors
end

#requestObject (readonly)

Returns the value of attribute request.



9
10
11
# File 'lib/rottweiler/auth/result.rb', line 9

def request
  @request
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rottweiler/auth/result.rb', line 20

def valid?
  @errors.empty?
end