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.



108
109
110
111
# File 'lib/bamboo-client/rest.rb', line 108

def initialize(data, http)
  @data = data
  @http = http
end

Instance Method Details

#keyObject



117
118
119
# File 'lib/bamboo-client/rest.rb', line 117

def key
  @data['key']
end

#nameObject



113
114
115
# File 'lib/bamboo-client/rest.rb', line 113

def name
  @data['name']
end

#plansObject



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.cookies).data
    end

    @data.fetch('plans').fetch('plan').map { |e| Plan.new(e, @http) }
  )
end

#urlObject



121
122
123
# File 'lib/bamboo-client/rest.rb', line 121

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