class HelperModule::SimpleHttpResult
Public Class Methods
new(response)
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 221 def initialize(response) @response = response end
Public Instance Methods
error_message()
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 237 def error_message is_success? ? '' : @response.body end
get_content()
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 241 def get_content is_success? ? JSON.parse(@response.body) : nil end
get_response()
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 229 def get_response @response end
is_success?()
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 233 def is_success? @response.code.to_i == 200 || @response.code.to_i == 201 end
to_s()
click to toggle source
# File lib/helpers/simple_http_helper.rb, line 225 def to_s @response.to_s end