Class: Ghee::API::Repos::Issues::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Ghee::API::Repos::Issues::Proxy
- Includes:
- CUD
- Defined in:
- lib/ghee/api/issues.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, #pagination, #params, #path_prefix, #total
Instance Method Summary collapse
-
#close ⇒ Object
Close issue - closed issue by id.
-
#closed ⇒ Object
Returns closed issues.
-
#comments(id = nil) ⇒ Object
Returns issue comments for an issue or all of the comments for a repo.
-
#events(id = nil) ⇒ Object
Returns issue events for a repo or issue number.
-
#labels ⇒ Object
Returns all of the labels for repo.
Methods included from CUD
Methods inherited from ResourceProxy
#all, #initialize, #method_missing, #paginate, #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
#close ⇒ Object
Close issue - closed issue by id
usage - ghee.repos(“my_repo”).issues(1).close
returns boolean
76 77 78 |
# File 'lib/ghee/api/issues.rb', line 76 def close connection.patch(path_prefix,:state => "closed").body["state"] == "closed" end |
#closed ⇒ Object
Returns closed issues
Returns json
84 85 86 87 88 89 |
# File 'lib/ghee/api/issues.rb', line 84 def closed response = connection.get path_prefix do |req| req.params["state"] = "closed" end response.body end |
#comments(id = nil) ⇒ Object
Returns issue comments for an issue or all of the comments for a repo
93 94 95 96 |
# File 'lib/ghee/api/issues.rb', line 93 def comments(id=nil) prefix = id ? "#{path_prefix}/comments/#{id}" : "#{path_prefix}/comments" Ghee::API::Repos::Issues::Comments::Proxy.new(connection,prefix) end |