class OctocatHerder::PullRequest::Repo

A representation of the repsoitory meta-data returned from the pull request API. This is only ever useful when returned from OctocatHerder::PullRequest#head or OctocatHerder::PullRequest#base.

Public Instance Methods

repo() click to toggle source

The detailed information about the repository.

@since 0.0.1 @return [OctocatHerder::Repository]

# File lib/octocat_herder/pull_request/repo.rb, line 60
def repo
  @repo ||= OctocatHerder::Repository.new(@raw['repo'], connection)
end
user() click to toggle source

The owner of this repository.

@note This is cached locally to the instance of OctocatHerder::PullRequest::Repo, but will make an additional API request to populate it initially.

@since 0.0.1 @return [OctocatHerder::User]

# File lib/octocat_herder/pull_request/repo.rb, line 52
def user
  @user ||= OctocatHerder::User.fetch(@raw['user'], connection)
end
user_avatar_url() click to toggle source

The URL to the avatar image of the owner of this repository.

@since 0.0.1 @return [String]

# File lib/octocat_herder/pull_request/repo.rb, line 34
def user_avatar_url
  @raw['user']['avatar_url']
end
user_id() click to toggle source

The ID number of the owner of this repository.

@since 0.0.1 @return [Integer]

# File lib/octocat_herder/pull_request/repo.rb, line 26
def user_id
  @raw['user']['id']
end
user_login() click to toggle source

The login name of the owner of this repository.

@since 0.0.1 @return [String]

# File lib/octocat_herder/pull_request/repo.rb, line 18
def user_login
  @raw['user']['login']
end
user_url() click to toggle source

The URL of the owner of this repository.

@since 0.0.1 @return [String]

# File lib/octocat_herder/pull_request/repo.rb, line 42
def user_url
  @raw['user']['url']
end

Private Instance Methods

addtional_attributes() click to toggle source
# File lib/octocat_herder/pull_request/repo.rb, line 66
def addtional_attributes
  ['user_login', 'user_id', 'user_avatar_url', 'user_url']
end