Class: Firebase::Auth::Response
- Inherits:
-
Object
- Object
- Firebase::Auth::Response
- Defined in:
- lib/firebase/auth/response.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
- #headers ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #raw_body ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/firebase/auth/response.rb', line 6 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/firebase/auth/response.rb', line 4 def response @response end |
Instance Method Details
#body ⇒ Object
10 11 12 |
# File 'lib/firebase/auth/response.rb', line 10 def body JSON.parse(response.body, :quirks_mode => true) end |
#code ⇒ Object
22 23 24 |
# File 'lib/firebase/auth/response.rb', line 22 def code response.code end |
#headers ⇒ Object
26 27 28 |
# File 'lib/firebase/auth/response.rb', line 26 def headers response.headers end |
#raw_body ⇒ Object
14 15 16 |
# File 'lib/firebase/auth/response.rb', line 14 def raw_body response.body end |
#success? ⇒ Boolean
18 19 20 |
# File 'lib/firebase/auth/response.rb', line 18 def success? [200, 204].include? response.code end |