Class: Codeship::Builds

Inherits:
Object
  • Object
show all
Includes:
Request, Response
Defined in:
lib/codeship/builds.rb

Instance Method Summary collapse

Methods included from Response

#handle

Methods included from Request

#http_request

Constructor Details

#initialize(api_key = nil) ⇒ Builds

Returns a new instance of Builds.



10
11
12
# File 'lib/codeship/builds.rb', line 10

def initialize api_key = nil
  @api_key = api_key
end

Instance Method Details

#restart(id) ⇒ Object

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
# 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