Class: HasuraHandler::Authenticator
- Inherits:
-
Object
- Object
- HasuraHandler::Authenticator
- Defined in:
- lib/hasura_handler/authenticator.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(headers) ⇒ Authenticator
constructor
A new instance of Authenticator.
- #success? ⇒ Boolean
Constructor Details
#initialize(headers) ⇒ Authenticator
Returns a new instance of Authenticator.
7 8 9 10 |
# File 'lib/hasura_handler/authenticator.rb', line 7 def initialize(headers) @headers = headers @response = {} end |
Instance Attribute Details
#error_message ⇒ Object
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/hasura_handler/authenticator.rb', line 4 def @error_message end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/hasura_handler/authenticator.rb', line 3 def headers @headers end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/hasura_handler/authenticator.rb', line 4 def response @response end |
Instance Method Details
#success? ⇒ Boolean
12 13 14 15 16 17 18 19 20 |
# File 'lib/hasura_handler/authenticator.rb', line 12 def success? begin authenticate ensure return false if @response.blank? end @response.present? || @error_message.blank? end |