Class: Ghee::API::Repos::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Ghee::API::Repos::Proxy
- Defined in:
- lib/ghee/api/repos.rb,
lib/ghee/api/downloads.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
- #commits(sha = nil, params = {}) ⇒ Object
- #downloads(id = nil) ⇒ Object
- #git ⇒ Object
-
#hooks(number = nil, params = {}) ⇒ Object
Get hooks.
-
#issues(number = nil, params = {}) ⇒ Object
Get issues.
-
#labels(number = nil, params = {}) ⇒ Object
Get labels for a repo.
-
#milestones(number = nil, params = {}) ⇒ Object
Get milestones.
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
#commits(sha = nil, params = {}) ⇒ Object
81 82 83 84 85 |
# File 'lib/ghee/api/repos.rb', line 81 def commits(sha=nil, params={}) params = sha if sha.is_a?Hash prefix = (!sha.is_a?(Hash) and sha) ? "#{path_prefix}/commits/#{sha}" : "#{path_prefix}/commits" Ghee::API::Repos::Commits::Proxy.new(connection, prefix, params) end |
#downloads(id = nil) ⇒ Object
50 51 52 53 |
# File 'lib/ghee/api/downloads.rb', line 50 def downloads(id=nil) prefix = id ? "#{path_prefix}/downloads/#{id}" :"#{path_prefix}/downloads" Ghee::API::Repos::Downloads::Proxy.new(connection, prefix) end |
#git ⇒ Object
87 88 89 |
# File 'lib/ghee/api/repos.rb', line 87 def git Ghee::API::Repos::Git::Proxy.new(connection, "#{path_prefix}/git") end |
#hooks(number = nil, params = {}) ⇒ Object
Get hooks
Returns json
75 76 77 78 79 |
# File 'lib/ghee/api/repos.rb', line 75 def hooks(number=nil, params={}) params = number if number.is_a?Hash prefix = (!number.is_a?(Hash) and number) ? "#{path_prefix}/hooks/#{number}" : "#{path_prefix}/hooks" Ghee::API::Repos::Hooks::Proxy.new(connection, prefix, params) end |
#issues(number = nil, params = {}) ⇒ Object
Get issues
Returns json
43 44 45 46 47 |
# File 'lib/ghee/api/repos.rb', line 43 def issues(number=nil, params={}) params = number if number.is_a?Hash prefix = (!number.is_a?(Hash) and number) ? "#{path_prefix}/issues/#{number}" : "#{path_prefix}/issues" Ghee::API::Issues::Proxy.new(connection, prefix, params) end |
#labels(number = nil, params = {}) ⇒ Object
Get labels for a repo
id - Number get a specific label (optional)
Returns json
55 56 57 58 59 |
# File 'lib/ghee/api/repos.rb', line 55 def labels(number=nil, params={}) params = number if number.is_a?Hash prefix = (!number.is_a?(Hash) and number) ? "#{path_prefix}/labels/#{number}" : "#{path_prefix}/labels" Ghee::API::Repos::Labels::Proxy.new(connection, prefix, params) end |
#milestones(number = nil, params = {}) ⇒ Object
Get milestones
Returns json
65 66 67 68 69 |
# File 'lib/ghee/api/repos.rb', line 65 def milestones(number=nil, params={}) params = number if number.is_a?Hash prefix = (!number.is_a?(Hash) and number) ? "#{path_prefix}/milestones/#{number}" : "#{path_prefix}/milestones" Ghee::API::Milestones::Proxy.new(connection, prefix, params) end |