Class: Buildbox::API
- Inherits:
-
Object
- Object
- Buildbox::API
- Defined in:
- lib/buildbox/api.rb
Instance Method Summary collapse
- #agent(access_token, hostname) ⇒ Object
- #authenticate(api_key) ⇒ Object
-
#initialize(config = Buildbox.config) ⇒ API
constructor
A new instance of API.
- #scheduled_builds(project) ⇒ Object
- #update_build(build) ⇒ Object
Constructor Details
Instance Method Details
#agent(access_token, hostname) ⇒ Object
17 18 19 |
# File 'lib/buildbox/api.rb', line 17 def agent(access_token, hostname) put("agents/#{access_token}", :hostname => hostname) end |
#authenticate(api_key) ⇒ Object
12 13 14 15 |
# File 'lib/buildbox/api.rb', line 12 def authenticate(api_key) @api_key = api_key get("user") end |
#scheduled_builds(project) ⇒ Object
21 22 23 |
# File 'lib/buildbox/api.rb', line 21 def scheduled_builds(project) get(project.scheduled_builds_url).map { |build| Buildbox::Build.new(build) } end |
#update_build(build) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/buildbox/api.rb', line 25 def update_build(build) put(build.url, :started_at => build.started_at, :finished_at => build.finished_at, :output => build.output, :exit_status => build.exit_status) end |