class GitHubV3API

This is the main entry-point to the GitHub v3 API.

example:

api = GitHubV3API.new('users_github_oath2_access_token')

# access the GitHub Orgs API
api.orgs
#=> an instance of GitHubV3API::OrgsAPI

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

See GitHubV3API documentation in lib/github_v3_api.rb

Constants

MissingRequiredData

Raised when an API request is missing required data

NotFound

Raised when an API request returns a 404 error

Unauthorized

Raised when an API request uses an invalid access token

VERSION

Public Class Methods

new(access_token, api_url='https://api.github.com', header={}) click to toggle source

Returns a GitHubV3API instance that is able to access github with the access_token owner’s authorization.

access_token

an OAuth2 access token from GitHub

# File lib/github_v3_api.rb, line 37
def initialize(access_token, api_url='https://api.github.com', header={})
  @access_token = access_token
  @api_url = api_url
  @header = {:accept => :json,
             :authorization => "token #{@access_token}",
             :user_agent => "rubygem-github-v3-api"}
  @header.merge!(header) if header.is_a?(Hash)
end

Public Instance Methods

issues() click to toggle source

Entry-point for access to the GitHub Issues API

Returns an instance of GitHubV3API::IssuesAPI that will use the access_token associated with this instance

# File lib/github_v3_api.rb, line 74
def issues
  IssuesAPI.new(self)
end
orgs() click to toggle source

Entry-point for access to the GitHub Orgs API

Returns an instance of GitHubV3API::OrgsAPI that will use the access_token associated with this instance.

# File lib/github_v3_api.rb, line 58
def orgs
  OrgsAPI.new(self)
end
repos() click to toggle source

Entry-point for access to the GitHub Repos API

Returns an instance of GitHubV3API::ReposAPI that will use the access_token associated with this instance.

# File lib/github_v3_api.rb, line 66
def repos
  ReposAPI.new(self)
end
users() click to toggle source

Entry-point for access to the GitHub Users API

Returns an instance of GitHubV3API::UserAPI that will use the access_token associated with this instance.

# File lib/github_v3_api.rb, line 50
def users
  UsersAPI.new(self)
end