Class: Fcmpush::JsonResponse
- Inherits:
-
Net::HTTPResponse
- Object
- Net::HTTPResponse
- Fcmpush::JsonResponse
- Defined in:
- lib/fcmpush/json_response.rb
Constant Summary collapse
- HAS_SYMBOL_GC =
RUBY_VERSION > '2.2.0'
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
- #json ⇒ Object
- #parsable? ⇒ Boolean
Instance Method Details
#inspect ⇒ Object Also known as: to_s
14 15 16 |
# File 'lib/fcmpush/json_response.rb', line 14 def inspect "#<JsonResponse response: #{response.inspect}, json: #{json}>" end |
#json ⇒ Object
10 11 12 |
# File 'lib/fcmpush/json_response.rb', line 10 def json parsable? ? JSON.parse(body, symbolize_names: HAS_SYMBOL_GC) : nil end |
#parsable? ⇒ Boolean
19 20 21 |
# File 'lib/fcmpush/json_response.rb', line 19 def parsable? !body.nil? && !body.empty? end |