Class: OctocatHerder::PullRequest::Repo

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/octocat_herder/pull_request/repo.rb

Overview

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.

Instance Attribute Summary

Attributes included from Base

#connection, #raw

Instance Method Summary collapse

Methods included from Base

#available_attributes, #initialize, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OctocatHerder::Base

Instance Method Details

#repoOctocatHerder::Repository

The detailed information about the repository.

Returns:

Since:

  • 0.0.1



60
61
62
# File 'lib/octocat_herder/pull_request/repo.rb', line 60

def repo
  @repo ||= OctocatHerder::Repository.new(@raw['repo'], connection)
end

#userOctocatHerder::User

Note:

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

The owner of this repository.

Returns:

Since:

  • 0.0.1



52
53
54
# File 'lib/octocat_herder/pull_request/repo.rb', line 52

def user
  @user ||= OctocatHerder::User.fetch(@raw['user'], connection)
end

#user_avatar_urlString

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

Returns:

  • (String)

Since:

  • 0.0.1



34
35
36
# File 'lib/octocat_herder/pull_request/repo.rb', line 34

def user_avatar_url
  @raw['user']['avatar_url']
end

#user_idInteger

The ID number of the owner of this repository.

Returns:

  • (Integer)

Since:

  • 0.0.1



26
27
28
# File 'lib/octocat_herder/pull_request/repo.rb', line 26

def user_id
  @raw['user']['id']
end

#user_loginString

The login name of the owner of this repository.

Returns:

  • (String)

Since:

  • 0.0.1



18
19
20
# File 'lib/octocat_herder/pull_request/repo.rb', line 18

def 
  @raw['user']['login']
end

#user_urlString

The URL of the owner of this repository.

Returns:

  • (String)

Since:

  • 0.0.1



42
43
44
# File 'lib/octocat_herder/pull_request/repo.rb', line 42

def user_url
  @raw['user']['url']
end