Class: Ghee::API::Repos::Issues::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Ghee::API::Repos::Issues::Proxy
- Defined in:
- lib/ghee/api/issues.rb,
lib/ghee/api/search.rb
Overview
Gists::Proxy inherits from Ghee::Proxy and enables defining methods on the proxy object
Instance Attribute Summary collapse
-
#repo ⇒ Object
Returns the value of attribute repo.
Attributes inherited from ResourceProxy
#connection, #current_page, #id, #pagination, #params, #path_prefix, #total
Instance Method Summary collapse
- #assignees(&block) ⇒ Object
-
#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.
- #search(term, state = "open") ⇒ Object
Methods inherited from ResourceProxy
accept_header, #all, #all_parallel, #build_prefix, #initialize, #method_missing, #paginate, #raw, #subject
Methods included from CUD
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 Attribute Details
#repo ⇒ Object
Returns the value of attribute repo.
86 87 88 |
# File 'lib/ghee/api/issues.rb', line 86 def repo @repo end |
Instance Method Details
#assignees(&block) ⇒ Object
129 130 131 132 |
# File 'lib/ghee/api/issues.rb', line 129 def assignees(&block) prefix = "#{path_prefix}/assignees" Ghee::API::Repos::Issues::Assignees::Proxy.new(connection, prefix, &block) end |
#close ⇒ Object
Close issue - closed issue by id
usage - ghee.repos(“my_repo”).issues(1).close
returns boolean
94 95 96 |
# File 'lib/ghee/api/issues.rb', line 94 def close connection.patch(path_prefix,:state => "closed").body["state"] == "closed" end |
#closed ⇒ Object
Returns closed issues
Returns json
102 103 104 105 106 107 |
# File 'lib/ghee/api/issues.rb', line 102 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
111 112 113 114 |
# File 'lib/ghee/api/issues.rb', line 111 def comments(id=nil) prefix = id ? "#{path_prefix}/comments/#{id}" : "#{path_prefix}/comments" Ghee::API::Repos::Issues::Comments::Proxy.new(connection,prefix) end |
#events(id = nil) ⇒ Object
Returns issue events for a repo or issue number
124 125 126 127 |
# File 'lib/ghee/api/issues.rb', line 124 def events(id=nil) prefix = id ? "#{path_prefix}/events/#{id}" : "#{path_prefix}/events" Ghee::API::Repos::Issues::Events::Proxy.new(connection,prefix) end |