Method: Veye::API::Github.get_repo
- Defined in:
- lib/veye/api/github.rb
.get_repo(api_key, repo_name, branch = nil, file = nil) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/veye/api/github.rb', line 40 def self.get_repo(api_key, repo_name, branch = nil, file = nil) safe_repo_name = encode_repo_key(repo_name) github_api = Resource.new("#{RESOURCE_PATH}/#{safe_repo_name}") qparams = { api_key: api_key } qparams[:branch] = branch unless branch.nil? qparams[:file] = file unless file.nil? github_api.resource.get({ params: qparams }) do |response, request, result| JSONResponse.new(request, result, response) end end |