Class: Sappy::Responses::Auth
- Inherits:
-
Sappy::Response
- Object
- Sappy::Response
- Sappy::Responses::Auth
- Defined in:
- lib/sappy/responses/auth.rb
Defined Under Namespace
Classes: LoginFailed
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
Methods inherited from Sappy::Response
Constructor Details
This class inherits a constructor from Sappy::Response
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/sappy/responses/auth.rb', line 6 def key @key end |
Instance Method Details
#failure(code, message) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/sappy/responses/auth.rb', line 11 def failure(code, ) case code when "WRONG_DATA" raise LoginFailed, end end |
#success(hash) ⇒ Object
7 8 9 |
# File 'lib/sappy/responses/auth.rb', line 7 def success(hash) @key = hash["session"].first["key"] end |