Class: TrackerApi::Resources::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker_api/resources/project.rb

Instance Method Summary collapse

Instance Method Details

#create_story(params) ⇒ Story

Returns Story with given id.

Parameters:

  • hash (Hash)

    of attributes to create the story

Returns:

  • (Story)

    Story with given id



96
97
98
# File 'lib/tracker_api/resources/project.rb', line 96

def create_story(params)
  Endpoints::Story.new(client).create(id, params)
end

#epics(params = {}) ⇒ Array[Epic]

Returns epics associated with this project.

Returns:

  • (Array[Epic])

    epics associated with this project

Raises:

  • (ArgumentError)


49
50
51
52
53
54
# File 'lib/tracker_api/resources/project.rb', line 49

def epics(params={})
  raise ArgumentError, 'Expected @epics to be an Array' unless @epics.is_a? Array
  return @epics unless @epics.empty?

  @epics = Endpoints::Epics.new(client).get(id, params)
end

#iterations(params = {}) ⇒ Array[Iteration]

Returns iterations associated with this project.

Parameters:

  • params (Hash) (defaults to: {})

Options Hash (params):

  • :scope (String)

    Restricts the state of iterations to return. If not specified, it defaults to all iterations including done. Valid enumeration values: done, current, backlog, current_backlog.

  • :offset (Integer)

    The offset of first iteration to return, relative to the set of iterations specified by ‘scope’, with zero being the first iteration in the scope.

  • :limit (Integer)

    The number of iterations to return relative to the offset.

Returns:

  • (Array[Iteration])

    iterations associated with this project



64
65
66
# File 'lib/tracker_api/resources/project.rb', line 64

def iterations(params = {})
  Endpoints::Iterations.new(client).get(id, params)
end

#label_listString

Returns comma separated list of labels.

Returns:

  • (String)

    comma separated list of labels



44
45
46
# File 'lib/tracker_api/resources/project.rb', line 44

def label_list
  @label_list ||= labels.collect(&:name).join(',')
end

#memberships(params = {}) ⇒ Object



84
85
86
# File 'lib/tracker_api/resources/project.rb', line 84

def memberships(params = {})
  Endpoints::Memberships.new(client).get(id, params)
end

#stories(params = {}) ⇒ Array[Story]

Returns stories associated with this project.

Parameters:

  • params (Hash) (defaults to: {})

Options Hash (params):

  • :with_label (String)

    A label name which all returned stories must match.

  • :with_state (String)

    A story’s current_state which all returned stories must match. Valid enumeration values: accepted, delivered, finished, started, rejected, unstarted, unscheduled

  • :filter (String)

    This parameter supplies a search string; only stories that match the search criteria are returned. Cannot be used together with any other parameters except limit and offset. ex) state:started requester:OWK label:“jedi stuff” keyword

  • :offset (Integer)

    With the first story in your priority list as 0, the index of the first story you want returned.

  • :limit (Integer)

    The number of stories you want returned.

Returns:

  • (Array[Story])

    stories associated with this project



80
81
82
# File 'lib/tracker_api/resources/project.rb', line 80

def stories(params = {})
  Endpoints::Stories.new(client).get(id, params)
end

#story(story_id) ⇒ Story

Returns Story with given id.

Parameters:

  • story_id (Fixnum)

    id of story to get

Returns:

  • (Story)

    Story with given id



90
91
92
# File 'lib/tracker_api/resources/project.rb', line 90

def story(story_id)
  Endpoints::Story.new(client).get(id, story_id)
end