Class: Bamboo::Client::Rest::QueuedBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/bamboo-client/rest.rb

Overview

Queue

Instance Method Summary collapse

Constructor Details

#initialize(data, http) ⇒ QueuedBuild

Returns a new instance of QueuedBuild.



297
298
299
300
# File 'lib/bamboo-client/rest.rb', line 297

def initialize(data, http)
  @data = data
  @http = http
end

Instance Method Details

#build_numberObject



310
311
312
# File 'lib/bamboo-client/rest.rb', line 310

def build_number
  @data['buildNumber']
end

#build_result_keyObject



318
319
320
# File 'lib/bamboo-client/rest.rb', line 318

def build_result_key
  @data['buildResultKey']
end

#changesObject



326
327
328
329
330
331
332
333
334
# File 'lib/bamboo-client/rest.rb', line 326

def changes
  @changes ||= (
    unless @data['changes'] && @data['changes']['change']
      @data = @http.get(URI.parse(url), {:expand => 'changes'}, @http.cookies).data
    end

    @data.fetch('changes').fetch('change').map { |e| Change.new(e, @http) }
  )
end

#plan_keyObject



314
315
316
# File 'lib/bamboo-client/rest.rb', line 314

def plan_key
  @data['planKey']
end

#trigger_reasonObject



306
307
308
# File 'lib/bamboo-client/rest.rb', line 306

def trigger_reason
  @data['triggerReason']
end

#urlObject



302
303
304
# File 'lib/bamboo-client/rest.rb', line 302

def url
  @data.fetch("link")['href']
end