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.



103
104
105
106
# File 'lib/bamboo-client/rest.rb', line 103

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

Instance Method Details

#keyObject



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

def key
  @data['key']
end

#nameObject



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

def name
  @data['name']
end

#plansObject



120
121
122
123
124
125
126
127
128
# File 'lib/bamboo-client/rest.rb', line 120

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



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

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