module Github::Result

def body

def body
  loaded? ? @env[:body] : nil
end

def content_length

def content_length
  loaded? ? @env[:response_headers][CONTENT_LENGTH] : nil
end

def content_type

def content_type
  loaded? ? @env[:response_headers][CONTENT_TYPE] : nil
end

def loaded?

def loaded?
  !!env
end

def ratelimit

Requests are limited to API v3 to 5000 per hour.
def ratelimit
  loaded? ? @env[:response_headers][RATELIMIT] : nil
end

def status

def status
  loaded? ? @env[:status] : nil
end

def success?

def success?
  (200..299).include? status
end