Class: TinyGate::Types::SessionResponse
- Inherits:
-
Object
- Object
- TinyGate::Types::SessionResponse
- Defined in:
- lib/tiny_gate/types/session_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #global_user ⇒ Object
-
#initialize(response) ⇒ SessionResponse
constructor
A new instance of SessionResponse.
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ SessionResponse
Returns a new instance of SessionResponse.
9 10 11 12 |
# File 'lib/tiny_gate/types/session_response.rb', line 9 def initialize(response) @response = response @body = JSON.parse(response.body) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/tiny_gate/types/session_response.rb', line 7 def body @body end |
Instance Method Details
#global_user ⇒ Object
18 19 20 |
# File 'lib/tiny_gate/types/session_response.rb', line 18 def global_user Types::User[body] end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/tiny_gate/types/session_response.rb', line 14 def success? response.status == 200 end |