class Kongrations::Response

Public Class Methods

new(response, request) click to toggle source
# File lib/kongrations/response.rb, line 8
def initialize(response, request)
  @response = response
  @request = request
end

Public Instance Methods

body() click to toggle source
# File lib/kongrations/response.rb, line 21
def body
  JSON.parse(@response.body, symbolize_names: true) unless @response.body.nil?
end
data_to_save() click to toggle source
# File lib/kongrations/response.rb, line 25
def data_to_save
  nil
end
error?() click to toggle source
# File lib/kongrations/response.rb, line 17
def error?
  !success?
end
save_data(migration_name) click to toggle source
# File lib/kongrations/response.rb, line 29
def save_data(migration_name)
  MigrationData.save(migration_name, data_to_save)
end
success?() click to toggle source
# File lib/kongrations/response.rb, line 13
def success?
  @response.is_a?(Net::HTTPSuccess)
end