Class: Bamboo::Client::Rest::Plan

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

Instance Method Summary collapse

Constructor Details

#initialize(data, http) ⇒ Plan

Returns a new instance of Plan.



67
68
69
70
# File 'lib/bamboo-client/rest.rb', line 67

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

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/bamboo-client/rest.rb', line 72

def enabled?
  @data['enabled']
end

#keyObject



84
85
86
# File 'lib/bamboo-client/rest.rb', line 84

def key
  @data['key']
end

#nameObject



80
81
82
# File 'lib/bamboo-client/rest.rb', line 80

def name
  @data['name']
end

#queueObject



92
93
94
# File 'lib/bamboo-client/rest.rb', line 92

def queue
  @http.post File.join(SERVICE, "queue/#{URI.escape key}"), {}, @http.cookies
end

#resultsObject



96
97
98
99
# File 'lib/bamboo-client/rest.rb', line 96

def results
  doc = @http.get File.join(SERVICE, "result/#{URI.escape key}"), {}, @http.cookies
  doc.auto_expand Result, @http
end

#typeObject



76
77
78
# File 'lib/bamboo-client/rest.rb', line 76

def type
  @data['type'].downcase.to_sym
end

#urlObject



88
89
90
# File 'lib/bamboo-client/rest.rb', line 88

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