Class: Gitlang::Repository

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/gitlang/repository.rb

Overview

Class representing a GitHub organization’s repository.

Instance Method Summary collapse

Methods included from Utilities

#conditional_rescue

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_nameObject

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

#languagesObject

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