Class: Gitlang::Repository
- Inherits:
-
Object
- Object
- Gitlang::Repository
- Includes:
- Utilities
- Defined in:
- lib/gitlang/repository.rb
Overview
Class representing a GitHub organization’s repository.
Instance Method Summary collapse
-
#full_name ⇒ Object
Returns the full name of the repository as a string.
-
#initialize(organization_name, repository_name, client) ⇒ Repository
constructor
A new instance of Repository.
-
#languages ⇒ Object
Returns a hash containing the absolute usage of each language.
Methods included from Utilities
Constructor Details
#initialize(organization_name, repository_name, client) ⇒ Repository
Returns a new instance of Repository.
8 9 10 11 12 |
# File 'lib/gitlang/repository.rb', line 8 def initialize(organization_name, repository_name, client) @organization_name = organization_name @name = repository_name @client = client end |
Instance Method Details
#full_name ⇒ Object
Returns the full name of the repository as a string.
15 16 17 |
# File 'lib/gitlang/repository.rb', line 15 def full_name @organization_name + '/' + @name end |
#languages ⇒ Object
Returns a hash containing the absolute usage of each language.
20 21 22 |
# File 'lib/gitlang/repository.rb', line 20 def languages conditional_rescue { @client.languages(full_name) } end |