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.
114 115 116 117 |
# File 'lib/bamboo-client/rest.rb', line 114 def initialize(data, http) @data = data @http = http end |
Instance Method Details
#key ⇒ Object
123 124 125 |
# File 'lib/bamboo-client/rest.rb', line 123 def key @data['key'] end |
#name ⇒ Object
119 120 121 |
# File 'lib/bamboo-client/rest.rb', line 119 def name @data['name'] end |
#plans ⇒ Object
131 132 133 134 135 136 137 138 139 |
# File 'lib/bamboo-client/rest.rb', line 131 def plans @plans ||= ( unless @data['plans'] && @data['plans']['plan'] @data = @http.get(URI.parse(url), :expand => 'plans').data end @data.fetch('plans').fetch('plan').map { |e| Plan.new(e, @http) } ) end |
#url ⇒ Object
127 128 129 |
# File 'lib/bamboo-client/rest.rb', line 127 def url @data.fetch("link")['href'] end |