Class: Ghee::API::Repos::Git::Proxy
- Inherits:
-
ResourceProxy
- Object
- ResourceProxy
- Ghee::API::Repos::Git::Proxy
- Defined in:
- lib/ghee/api/git_data.rb
Instance Attribute Summary
Attributes inherited from ResourceProxy
#connection, #current_page, #id, #pagination, #params, #path_prefix, #total
Instance Method Summary collapse
-
#blobs(sha = nil, params = {}) ⇒ Object
Get the blob by a provided sha.
-
#commits(sha = nil, params = {}) ⇒ Object
Get a commit by the sha.
-
#refs(ref = nil) ⇒ Object
Get refs for the repo.
-
#tags(sha = nil) ⇒ Object
Get a tag by a given sha.
-
#trees(sha = nil, params = {}) ⇒ Object
Get tree by a given sha.
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 Method Details
#blobs(sha = nil, params = {}) ⇒ Object
Get the blob by a provided sha
64 65 66 67 68 |
# File 'lib/ghee/api/git_data.rb', line 64 def blobs(sha=nil, params={}) params = sha if sha.is_a?Hash prefix = (!sha.is_a?(Hash) and sha) ? "#{path_prefix}/blobs/#{sha}" : "#{path_prefix}/blobs" Ghee::API::Repos::Git::Blobs::Proxy.new(connection, prefix, params) end |
#commits(sha = nil, params = {}) ⇒ Object
Get a commit by the sha
72 73 74 75 76 |
# File 'lib/ghee/api/git_data.rb', line 72 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::Git::Commits::Proxy.new(connection, prefix, params) end |
#refs(ref = nil) ⇒ Object
Get refs for the repo
80 81 82 83 |
# File 'lib/ghee/api/git_data.rb', line 80 def refs(ref=nil) prefix = ref ? "#{path_prefix}/refs/#{ref}" : "#{path_prefix}/refs" Ghee::API::Repos::Git::Refs::Proxy.new(connection, prefix) end |