Module: Gitlab::Client::Milestones

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/milestones.rb

Overview

Defines methods related to milestones.

Instance Method Summary collapse

Instance Method Details

#create_milestone(project, title, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new milestone.

Parameters:

  • project (Integer)

    The ID of a project.

  • title (String)

    The title of a milestone.

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

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of a milestone.

  • :due_date (String)

    The due date of a milestone.

Returns:



38
39
40
41
# File 'lib/gitlab/client/milestones.rb', line 38

def create_milestone(project, title, options={})
  body = {:title => title}.merge(options)
  post("/projects/#{project}/milestones", :body => body)
end

#edit_milestone(project, id, options = {}) ⇒ Gitlab::ObjectifiedHash

Updates a milestone.

Parameters:

  • project (Integer)

    The ID of a project.

  • id (Integer)

    The ID of a milestone.

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

    A customizable set of options.

Options Hash (options):

  • :title (String)

    The title of a milestone.

  • :description (String)

    The description of a milestone.

  • :due_date (String)

    The due date of a milestone.

  • :state_event (String)

    The state of a milestone (‘close’ or ‘activate’).

Returns:



53
54
55
# File 'lib/gitlab/client/milestones.rb', line 53

def edit_milestone(project, id, options={})
  put("/projects/#{project}/milestones/#{id}", :body => options)
end

#milestone(project, id) ⇒ Gitlab::ObjectifiedHash

Gets a single milestone.

Examples:

Gitlab.milestone(5, 36)

Parameters:

  • project (Integer, String)

    The ID of a project.

  • id (Integer)

    The ID of a milestone.

Returns:



26
27
28
# File 'lib/gitlab/client/milestones.rb', line 26

def milestone(project, id)
  get("/projects/#{project}/milestones/#{id}")
end

#milestones(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of project’s milestones.

Examples:

Gitlab.milestones(5)

Parameters:

  • project (Integer)

    The ID of a project.

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

    A customizable set of options.

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:



14
15
16
# File 'lib/gitlab/client/milestones.rb', line 14

def milestones(project, options={})
  get("/projects/#{project}/milestones", :query => options)
end