class Codeship::Builds

Public Class Methods

new(api_key = nil) click to toggle source
# File lib/codeship/builds.rb, line 10
def initialize api_key = nil
  @api_key = api_key
end

Public Instance Methods

restart(id) click to toggle source
# File lib/codeship/builds.rb, line 14
def restart id
  raise ArgumentError, 'You need to set API key' if !@api_key
  @build_id = id
  @action = 'restart'
  resp = http_request.request_post builds_url, ''
  handle(resp)
end

Private Instance Methods

builds_url() click to toggle source
# File lib/codeship/builds.rb, line 24
def builds_url
  url = "/api/v1/builds.json"
  url = "/api/v1/builds/#{@build_id}.json" if @build_id
  url = "/api/v1/builds/#{@build_id}/#{@action}.json" if @build_id && @action
  url << "?api_key=#{@api_key}"
  url
end