Class: Bamboo::Client::Rest::Plan
- Inherits:
-
Object
- Object
- Bamboo::Client::Rest::Plan
- Defined in:
- lib/bamboo-client/rest.rb
Instance Method Summary collapse
- #building? ⇒ Boolean
- #enabled? ⇒ Boolean
-
#initialize(data, http) ⇒ Plan
constructor
A new instance of Plan.
- #key ⇒ Object
- #name ⇒ Object
- #queue(params = nil) ⇒ Object
- #results(params = {}) ⇒ Object
- #type ⇒ Object
- #url ⇒ Object
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
#building? ⇒ Boolean
107 108 109 |
# File 'lib/bamboo-client/rest.rb', line 107 def building? @data['isBuilding'] end |
#enabled? ⇒ Boolean
72 73 74 |
# File 'lib/bamboo-client/rest.rb', line 72 def enabled? @data['enabled'] end |
#key ⇒ Object
84 85 86 |
# File 'lib/bamboo-client/rest.rb', line 84 def key @data['key'] end |
#name ⇒ Object
80 81 82 |
# File 'lib/bamboo-client/rest.rb', line 80 def name @data['name'] end |
#queue(params = nil) ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/bamboo-client/rest.rb', line 92 def queue(params = nil) path = File.join(SERVICE, "queue/#{URI.escape key}") if params @http.post_with_query path, params else @http.post path, {} end end |
#results(params = {}) ⇒ Object
102 103 104 105 |
# File 'lib/bamboo-client/rest.rb', line 102 def results(params = {}) doc = @http.get File.join(SERVICE, "result/#{URI.escape key}"), params doc. Result, @http end |
#type ⇒ Object
76 77 78 |
# File 'lib/bamboo-client/rest.rb', line 76 def type @data['type'].downcase.to_sym end |
#url ⇒ Object
88 89 90 |
# File 'lib/bamboo-client/rest.rb', line 88 def url @data.fetch("link")['href'] end |