Class: Ghee::API::Repos::Milestones::Proxy

Inherits:
ResourceProxy show all
Includes:
CUD
Defined in:
lib/ghee/api/milestones.rb

Overview

Gists::Proxy inherits from Ghee::Proxy and enables defining methods on the proxy object

Instance Attribute Summary

Attributes inherited from ResourceProxy

#connection, #current_page, #id, #pagination, #params, #path_prefix, #total

Instance Method Summary collapse

Methods included from CUD

#create, #destroy, #patch

Methods inherited from ResourceProxy

accept_header, #all, #all_parallel, #build_prefix, #initialize, #method_missing, #paginate, #raw, #subject

Constructor Details

This class inherits a constructor from Ghee::ResourceProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ghee::ResourceProxy

Instance Method Details

#closeObject

Close milestone - closed milestone by id

usage - ghee.repos(“my_repo”).milestones(1).close

returns boolean



28
29
30
# File 'lib/ghee/api/milestones.rb', line 28

def close
  connection.patch(path_prefix,:state => "closed").body["state"] == "closed"
end

#closedObject

Returns closed milestones

Returns json



36
37
38
39
40
41
# File 'lib/ghee/api/milestones.rb', line 36

def closed
  response = connection.get path_prefix do |req|
    req.params["state"] = "closed"
  end
  response.body
end