Class: Idsimple::Rack::AccessTokenValidationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/idsimple/rack/access_token_validation_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAccessTokenValidationResult

Returns a new instance of AccessTokenValidationResult.



6
7
8
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 6

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 4

def errors
  @errors
end

Instance Method Details

#add_error(msg) ⇒ Object



18
19
20
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 18

def add_error(msg)
  @errors << msg
end

#full_error_messageObject



22
23
24
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 22

def full_error_message
  "#{errors.join(". ")}." unless errors.empty?
end

#invalid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 14

def invalid?
  !valid?
end

#valid?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/idsimple/rack/access_token_validation_result.rb', line 10

def valid?
  errors.empty?
end