Class: Andpush::JsonResponse
- Inherits:
-
Net::HTTPResponse
- Object
- Net::HTTPResponse
- Andpush::JsonResponse
- Defined in:
- lib/andpush/json_handler.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/andpush/json_handler.rb', line 14 def inspect "#<JsonResponse response: #{response.inspect}, json: #{json}>" end |
#json ⇒ Object
10 11 12 |
# File 'lib/andpush/json_handler.rb', line 10 def json parsable? ? JSON.parse(body, symbolize_names: HAS_SYMBOL_GC) : nil end |
#parsable? ⇒ Boolean
19 20 21 |
# File 'lib/andpush/json_handler.rb', line 19 def parsable? !!body && !body.empty? end |