Class: Garage::Strategy::AuthServer::Response
- Inherits:
-
Object
- Object
- Garage::Strategy::AuthServer::Response
- Defined in:
- lib/garage/strategy/auth_server.rb
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(raw) ⇒ Response
constructor
A new instance of Response.
- #status_code ⇒ Object
- #to_hash ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(raw) ⇒ Response
Returns a new instance of Response.
180 181 182 |
# File 'lib/garage/strategy/auth_server.rb', line 180 def initialize(raw) @raw = raw end |
Instance Method Details
#body ⇒ Object
196 197 198 |
# File 'lib/garage/strategy/auth_server.rb', line 196 def body @raw.body end |
#status_code ⇒ Object
192 193 194 |
# File 'lib/garage/strategy/auth_server.rb', line 192 def status_code @raw.code.to_i end |
#to_hash ⇒ Object
188 189 190 |
# File 'lib/garage/strategy/auth_server.rb', line 188 def to_hash parsed_body.symbolize_keys end |
#valid? ⇒ Boolean
184 185 186 |
# File 'lib/garage/strategy/auth_server.rb', line 184 def valid? status_code == 200 && json? && parsed_body.is_a?(Hash) end |