Class: DvelpApiAuth::Authentication::Validator
- Inherits:
-
Object
- Object
- DvelpApiAuth::Authentication::Validator
- Includes:
- HelperMethods
- Defined in:
- lib/dvelp_api_auth/authentication/validator.rb
Instance Attribute Summary collapse
-
#client_authorization_code ⇒ Object
readonly
Returns the value of attribute client_authorization_code.
-
#server_signature ⇒ Object
readonly
Returns the value of attribute server_signature.
Instance Method Summary collapse
- #authentic? ⇒ Boolean
-
#initialize(client_authorization_code, request_timestamp, server_signature) ⇒ Validator
constructor
A new instance of Validator.
Methods included from HelperMethods
Constructor Details
#initialize(client_authorization_code, request_timestamp, server_signature) ⇒ Validator
Returns a new instance of Validator.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dvelp_api_auth/authentication/validator.rb', line 9 def initialize( , , server_signature ) = = @server_signature = server_signature unless present?() raise 'Client authorization code is required' end unless present?(@server_signature) raise 'Server signature is required' end unless present?() raise 'Timestamp is required' end end |
Instance Attribute Details
#client_authorization_code ⇒ Object (readonly)
Returns the value of attribute client_authorization_code.
7 8 9 |
# File 'lib/dvelp_api_auth/authentication/validator.rb', line 7 def end |
#server_signature ⇒ Object (readonly)
Returns the value of attribute server_signature.
7 8 9 |
# File 'lib/dvelp_api_auth/authentication/validator.rb', line 7 def server_signature @server_signature end |
Instance Method Details
#authentic? ⇒ Boolean
29 30 31 |
# File 'lib/dvelp_api_auth/authentication/validator.rb', line 29 def authentic? valid_signature? && end |