Class: Bamboo::Client::Rest::Project
- Inherits:
-
Object
- Object
- Bamboo::Client::Rest::Project
- Defined in:
- lib/bamboo-client/rest.rb
Overview
Plan
Instance Method Summary collapse
-
#initialize(data, http) ⇒ Project
constructor
A new instance of Project.
- #key ⇒ Object
- #name ⇒ Object
- #plans ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(data, http) ⇒ Project
Returns a new instance of Project.
108 109 110 111 |
# File 'lib/bamboo-client/rest.rb', line 108 def initialize(data, http) @data = data @http = http end |
Instance Method Details
#key ⇒ Object
117 118 119 |
# File 'lib/bamboo-client/rest.rb', line 117 def key @data['key'] end |
#name ⇒ Object
113 114 115 |
# File 'lib/bamboo-client/rest.rb', line 113 def name @data['name'] end |
#plans ⇒ Object
125 126 127 128 129 130 131 132 133 |
# File 'lib/bamboo-client/rest.rb', line 125 def plans @plans ||= ( unless @data['plans'] && @data['plans']['plan'] @data = @http.get(URI.parse(url), {:expand => 'plans'}, @http.).data end @data.fetch('plans').fetch('plan').map { |e| Plan.new(e, @http) } ) end |
#url ⇒ Object
121 122 123 |
# File 'lib/bamboo-client/rest.rb', line 121 def url @data.fetch("link")['href'] end |