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.
Attributes inherited from Sappy::Response
Instance Method Summary collapse
Methods inherited from Sappy::Response
#error_response, #error_response?, #first_xpath, #initialize, parse, #parse
Constructor Details
This class inherits a constructor from Sappy::Response
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/sappy/responses/auth.rb', line 5 def key @key end |
Instance Method Details
#failure(code, message) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/sappy/responses/auth.rb', line 12 def failure(code, ) case code when "WRONG_DATA" raise LoginFailed, end end |
#success ⇒ Object
7 8 9 10 |
# File 'lib/sappy/responses/auth.rb', line 7 def success node = first_xpath('//session') @key = node && node["key"] end |