Class: Bamboo::Client::Rest::Plan
- Inherits:
-
Object
- Object
- Bamboo::Client::Rest::Plan
- Defined in:
- lib/bamboo-client/rest.rb
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(data, http) ⇒ Plan
constructor
A new instance of Plan.
- #key ⇒ Object
- #name ⇒ Object
- #queue ⇒ Object
- #results ⇒ 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
#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 ⇒ Object
92 93 94 |
# File 'lib/bamboo-client/rest.rb', line 92 def queue @http.post File.join(SERVICE, "queue/#{URI.escape key}"), {}, @http. end |
#results ⇒ Object
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. 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 |