Class: OctocatHerder

Inherits:
Object
  • Object
show all
Defined in:
lib/octocat_herder.rb,
lib/octocat_herder/base.rb,
lib/octocat_herder/user.rb,
lib/octocat_herder/connection.rb,
lib/octocat_herder/repository.rb,
lib/octocat_herder/pull_request.rb,
lib/octocat_herder/pull_request/repo.rb

Overview

This is just a convenience class to serve as a jumping-off point into the rest of the GitHub API. You don’t have to use this, if you don’t want; you can use the other classes directly, constructing your own OctocatHerder::Connection to pass to them.

This provides convenience methods for the following:

  • OctocatHerder::User

Defined Under Namespace

Modules: Base Classes: Connection, PullRequest, Repository, User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ OctocatHerder

Get a new OctocatHerder for use with the GitHub v3 API.

Parameters:

  • options (Hash) (defaults to: {})

    Passed to OctocatHerder::Connection.new

See Also:

  • OctocatHerder::Connection.new

Since:

  • 0.0.1



23
24
25
# File 'lib/octocat_herder.rb', line 23

def initialize(options={})
  @connection = OctocatHerder::Connection.new(options)
end

Instance Attribute Details

#connectionObject (readonly)

The instance of OctocatHerder::Connection used for making API requests.

Since:

  • 0.0.1



16
17
18
# File 'lib/octocat_herder.rb', line 16

def connection
  @connection
end

Instance Method Details

#user(user_name) ⇒ Object

Fetch an OctocatHerder::User by using OctocatHerder::User.fetch and the OctocatHerder::Connection from #connection

Parameters:

  • user_name (String)

    The login name of the GitHub user to retrieve.

Since:

  • 0.0.1



32
33
34
# File 'lib/octocat_herder.rb', line 32

def user(user_name)
  OctocatHerder::User.fetch(user_name, connection)
end