Exception: FirebaseCloudMessenger::Error
- Inherits:
-
BaseError
- Object
- StandardError
- BaseError
- FirebaseCloudMessenger::Error
show all
- Defined in:
- lib/firebase_cloud_messenger/error.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response = nil) ⇒ Error
Returns a new instance of Error.
22
23
24
25
26
|
# File 'lib/firebase_cloud_messenger/error.rb', line 22
def initialize(response = nil)
@response = response
super(error_message)
end
|
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
6
7
8
|
# File 'lib/firebase_cloud_messenger/error.rb', line 6
def response
@response
end
|
Class Method Details
.from_response(response) ⇒ Object
Instance Method Details
#details ⇒ Object
40
41
42
|
# File 'lib/firebase_cloud_messenger/error.rb', line 40
def details
parsed_response["error"]["details"]
end
|
#parsed_response ⇒ Object
36
37
38
|
# File 'lib/firebase_cloud_messenger/error.rb', line 36
def parsed_response
JSON.parse(response_body)
end
|
#response_body ⇒ Object
32
33
34
|
# File 'lib/firebase_cloud_messenger/error.rb', line 32
def response_body
response.body
end
|
#response_status ⇒ Object
28
29
30
|
# File 'lib/firebase_cloud_messenger/error.rb', line 28
def response_status
response.code.to_i
end
|
#short_message ⇒ Object
44
45
46
|
# File 'lib/firebase_cloud_messenger/error.rb', line 44
def short_message
parsed_response["error"]["message"]
end
|