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.



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

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

Instance Method Details

#build_numberObject



320
321
322
# File 'lib/bamboo-client/rest.rb', line 320

def build_number
  @data['buildNumber']
end

#build_result_keyObject



328
329
330
# File 'lib/bamboo-client/rest.rb', line 328

def build_result_key
  @data['buildResultKey']
end

#changesObject



336
337
338
339
340
341
342
343
344
# File 'lib/bamboo-client/rest.rb', line 336

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

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

#plan_keyObject



324
325
326
# File 'lib/bamboo-client/rest.rb', line 324

def plan_key
  @data['planKey']
end

#trigger_reasonObject



316
317
318
# File 'lib/bamboo-client/rest.rb', line 316

def trigger_reason
  @data['triggerReason']
end

#urlObject



312
313
314
# File 'lib/bamboo-client/rest.rb', line 312

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