class Safettp::Response
Attributes
http_response[R]
parser[R]
Public Class Methods
new(http_response, parser = Safettp::Parsers::JSON)
click to toggle source
# File lib/safettp/response.rb, line 4 def initialize(http_response, parser = Safettp::Parsers::JSON) @http_response = http_response @parser = parser end
Public Instance Methods
failure?()
click to toggle source
# File lib/safettp/response.rb, line 13 def failure? !success? end
parsed_body()
click to toggle source
# File lib/safettp/response.rb, line 17 def parsed_body parser.decode(http_response.body) end
success?()
click to toggle source
# File lib/safettp/response.rb, line 9 def success? @http_response.kind_of? Net::HTTPSuccess end