Class: Bamboo::Client::Rest::Project

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

Overview

Plan

Instance Method Summary collapse

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

#keyObject



123
124
125
# File 'lib/bamboo-client/rest.rb', line 123

def key
  @data['key']
end

#nameObject



119
120
121
# File 'lib/bamboo-client/rest.rb', line 119

def name
  @data['name']
end

#plansObject



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

#urlObject



127
128
129
# File 'lib/bamboo-client/rest.rb', line 127

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