module Ecoportal module API module Common class Response attr_reader :status, :body def initialize(response) @status = response.status @body = JSON.parse(response.to_s) rescue nil response.flush end def success? @status.success? end def print puts "Status: #{@status.code}" puts "Body:" puts JSON.pretty_generate(@body) end end end end end