Class: Microclimate::Repository
- Extended by:
- Forwardable
- Defined in:
- lib/microclimate/repository.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#repo_id ⇒ Object
Returns the value of attribute repo_id.
Instance Method Summary collapse
- #branch_for(branch_name) ⇒ Object
-
#initialize(client, options) ⇒ Repository
constructor
A new instance of Repository.
- #ready? ⇒ Boolean
-
#refresh! ⇒ Object
Force Code Climate to refresh this repository (at the master branch).
- #status ⇒ Object
- #www_url ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(client, options) ⇒ Repository
Returns a new instance of Repository.
11 12 13 14 |
# File 'lib/microclimate/repository.rb', line 11 def initialize(client, ) @client = client @repo_id = [:repo_id] end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/microclimate/repository.rb', line 5 def client @client end |
#repo_id ⇒ Object
Returns the value of attribute repo_id.
5 6 7 |
# File 'lib/microclimate/repository.rb', line 5 def repo_id @repo_id end |
Instance Method Details
#branch_for(branch_name) ⇒ Object
39 40 41 |
# File 'lib/microclimate/repository.rb', line 39 def branch_for(branch_name) Branch.new(client, self, branch_name) end |
#ready? ⇒ Boolean
29 30 31 |
# File 'lib/microclimate/repository.rb', line 29 def ready? !last_snapshot.nil? end |
#refresh! ⇒ Object
Force Code Climate to refresh this repository (at the master branch)
23 24 25 26 27 |
# File 'lib/microclimate/repository.rb', line 23 def refresh! output = connection.post resource_refresh_url, :api_token => api_token json = output.body Response.new JSON.parse(json) end |
#status ⇒ Object
33 34 35 36 37 |
# File 'lib/microclimate/repository.rb', line 33 def status output = connection.get resource_url, :api_token => api_token json = output.body Response.new JSON.parse(json) end |
#www_url ⇒ Object
43 44 45 |
# File 'lib/microclimate/repository.rb', line 43 def www_url "https://codeclimate.com/repos/#{repo_id}" end |