class CircleCIBuildReport::CircleAPIRequest

Attributes

branch[R]
offset[R]
org[R]
project[R]
token[R]

Public Class Methods

new(org, project, branch, token, offset) click to toggle source
# File lib/circleci_build_report.rb, line 101
def initialize(org, project, branch, token, offset)
  @org = org
  @project = project
  @branch = branch
  @token = token
  @offset = offset
end

Public Instance Methods

http() click to toggle source
# File lib/circleci_build_report.rb, line 122
def http
  @http ||= Net::HTTP.new(uri.host, uri.port)
end
perform() click to toggle source
# File lib/circleci_build_report.rb, line 109
def perform
  http.use_ssl = true
  response = http.get(query_params)
end
query_params() click to toggle source
# File lib/circleci_build_report.rb, line 114
def query_params
  "/api/v1.1/project/github/#{org}/#{project}/tree/#{branch}?circle-token=#{token}&limit=100&offset=#{offset}"
end
uri() click to toggle source
# File lib/circleci_build_report.rb, line 118
def uri
  @uri ||= URI.parse('https://circleci.com')
end