Class: PivotalAPI::Project

Inherits:
Base
  • Object
show all
Defined in:
lib/pivotal-tracker-api/project.rb

Direct Known Subclasses

Projects

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_json

Constructor Details

This class inherits a constructor from PivotalAPI::Base

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def 
  @account_id
end

#bugs_and_chores_are_estimatableObject

Returns the value of attribute bugs_and_chores_are_estimatable.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def bugs_and_chores_are_estimatable
  @bugs_and_chores_are_estimatable
end

#created_atObject

Returns the value of attribute created_at.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def created_at
  @created_at
end

#current_iteration_numberObject

Returns the value of attribute current_iteration_number.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def current_iteration_number
  @current_iteration_number
end

#current_velocityObject

Returns the value of attribute current_velocity.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def current_velocity
  @current_velocity
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def description
  @description
end

#enable_planned_modeObject

Returns the value of attribute enable_planned_mode.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def enable_planned_mode
  @enable_planned_mode
end

#epic_idsObject

Returns the value of attribute epic_ids.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def epic_ids
  @epic_ids
end

#has_google_domainObject

Returns the value of attribute has_google_domain.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def has_google_domain
  @has_google_domain
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def id
  @id
end

#integration_idsObject

Returns the value of attribute integration_ids.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def integration_ids
  @integration_ids
end

#iteration_lengthObject

Returns the value of attribute iteration_length.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def iteration_length
  @iteration_length
end

#iteration_override_numbersObject

Returns the value of attribute iteration_override_numbers.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def iteration_override_numbers
  @iteration_override_numbers
end

#kindObject

Returns the value of attribute kind.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def kind
  @kind
end

#label_idsObject

Returns the value of attribute label_ids.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def label_ids
  @label_ids
end

#labelsObject

Returns the value of attribute labels.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def labels
  @labels
end

#membership_idsObject

Returns the value of attribute membership_ids.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def membership_ids
  @membership_ids
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def name
  @name
end

#number_of_done_iterations_to_showObject

Returns the value of attribute number_of_done_iterations_to_show.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def number_of_done_iterations_to_show
  @number_of_done_iterations_to_show
end

#point_scaleObject

Returns the value of attribute point_scale.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def point_scale
  @point_scale
end

#point_scale_is_customObject

Returns the value of attribute point_scale_is_custom.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def point_scale_is_custom
  @point_scale_is_custom
end

#profile_contentObject

Returns the value of attribute profile_content.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def profile_content
  @profile_content
end

#publicObject

Returns the value of attribute public.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def public
  @public
end

#shown_iterations_start_timeObject

Returns the value of attribute shown_iterations_start_time.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def shown_iterations_start_time
  @shown_iterations_start_time
end

#start_dateObject

Returns the value of attribute start_date.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def start_date
  @start_date
end

#start_timeObject

Returns the value of attribute start_time.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def start_time
  @start_time
end

#story_idsObject

Returns the value of attribute story_ids.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def story_ids
  @story_ids
end

#time_zoneObject

Returns the value of attribute time_zone.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def time_zone
  @time_zone
end

#updated_atObject

Returns the value of attribute updated_at.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def updated_at
  @updated_at
end

#velocity_averaged_overObject

Returns the value of attribute velocity_averaged_over.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def velocity_averaged_over
  @velocity_averaged_over
end

#versionObject

Returns the value of attribute version.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def version
  @version
end

#week_start_dayObject

Returns the value of attribute week_start_day.



4
5
6
# File 'lib/pivotal-tracker-api/project.rb', line 4

def week_start_day
  @week_start_day
end

Class Method Details

.fieldsObject



13
14
15
# File 'lib/pivotal-tracker-api/project.rb', line 13

def fields
  ['description', 'labels', 'name', 'current_velocity', 'velocity_averaged_over']
end

.from_json(json) ⇒ Object



17
18
19
# File 'lib/pivotal-tracker-api/project.rb', line 17

def from_json(json)
  parse_json_project(json)
end

.retrieve(project_id) ⇒ Object



21
22
23
# File 'lib/pivotal-tracker-api/project.rb', line 21

def retrieve(project_id)
  Service.project(project_id: project_id, fields: Project.fields)
end

Instance Method Details

#activity(opts = {}) ⇒ Object



41
42
43
44
45
# File 'lib/pivotal-tracker-api/project.rb', line 41

def activity(opts={})
  opts[:project_id] = id
  
  Service.activity(opts)
end

#current_iterationObject



74
75
76
# File 'lib/pivotal-tracker-api/project.rb', line 74

def current_iteration
  iterations.first
end

#iterations(opts = {}) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/pivotal-tracker-api/project.rb', line 66

def iterations(opts={})
  opts[:project_id] = id
  opts[:parameters] = {} unless opts[:parameters]
  opts[:fields] = Iteration.fields if opts[:fields].nil?
  
  Service.iterations(opts)
end

#next_iterationObject



82
83
84
# File 'lib/pivotal-tracker-api/project.rb', line 82

def next_iteration
  iterations(scope: 'backlog').first
end

#previous_iterationObject



78
79
80
# File 'lib/pivotal-tracker-api/project.rb', line 78

def previous_iteration
  iterations(scope: 'done').first
end

#stories(opts = {}) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/pivotal-tracker-api/project.rb', line 58

def stories(opts={})
  opts[:project_id] = id
  opts[:parameters] = {} unless opts[:parameters]
  opts[:parameters][:fields] = Story.fields
  
  Service.stories(opts)
end

#story(story_id, opts = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'lib/pivotal-tracker-api/project.rb', line 47

def story(story_id, opts={})
  opts[:project_id] = id
  opts[:story_id] = story_id
  opts[:parameters] = {} unless opts[:parameters]
  opts[:parameters][:fields] = Story.fields
  
  story = Service.story(opts)
  story.project_id = id if story && story.project_id.nil?
  story
end