Class: Github::Client

Inherits:
API
  • Object
show all
Defined in:
lib/github_api/client.rb

Constant Summary

Constant Summary

Constants included from Request

Request::METHODS, Request::METHODS_WITH_BODIES

Constants included from Connection

Github::Connection::ALLOWED_OPTIONS

Constants included from Constants

Github::Constants::ACCEPT, Github::Constants::ACCEPTED_OAUTH_SCOPES, Github::Constants::ACCEPT_CHARSET, Github::Constants::CACHE_CONTROL, Github::Constants::CONTENT_LENGTH, Github::Constants::CONTENT_TYPE, Github::Constants::DATE, Github::Constants::ETAG, Github::Constants::HEADER_LAST, Github::Constants::HEADER_LINK, Github::Constants::HEADER_NEXT, Github::Constants::LOCATION, Github::Constants::META_FIRST, Github::Constants::META_LAST, Github::Constants::META_NEXT, Github::Constants::META_PREV, Github::Constants::META_REL, Github::Constants::OAUTH_SCOPES, Github::Constants::PARAM_PAGE, Github::Constants::PARAM_PER_PAGE, Github::Constants::PARAM_START_PAGE, Github::Constants::RATELIMIT_LIMIT, Github::Constants::RATELIMIT_REMAINING, Github::Constants::SERVER, Github::Constants::USER_AGENT

Constants included from MimeType

MimeType::MEDIA_LOOKUP

Instance Attribute Summary

Attributes inherited from API

#current_options

Instance Method Summary (collapse)

Methods inherited from API

#api_methods_in, #append_arguments, #arguments, inherited, #initialize, #method_missing, #process_basic_auth, #set, #setup, #with, #yield_or_eval

Methods included from RateLimit

#ratelimit, #ratelimit_remaining

Methods included from Request

#delete_request, #get_request, #patch_request, #post_request, #put_request, #request

Methods included from Connection

#caching?, #clear_cache, #connection, #default_middleware, #default_options, #stack

Methods included from MimeType

#lookup_media, #parse

Methods included from Authorization

#auth_code, #authenticated?, #authentication, #authorize_url, #basic_authed?, #client, #get_token

Constructor Details

This class inherits a constructor from Github::API

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Github::API

Instance Method Details

- (Object) activity(options = {}, &block)

Serving up the ‘social’ in Social Coding™, the Activity APIs provide access to notifications, subscriptions, and timelines.



9
10
11
# File 'lib/github_api/client.rb', line 9

def activity(options={}, &block)
  @activity ||= ApiFactory.new('Activity', current_options.merge(options), &block)
end

- (Object) emojis(options = {}, &block)



13
14
15
# File 'lib/github_api/client.rb', line 13

def emojis(options={}, &block)
  @emojis ||= ApiFactory.new('Emojis', current_options.merge(options), &block)
end

- (Object) gists(options = {}, &block)



17
18
19
# File 'lib/github_api/client.rb', line 17

def gists(options={}, &block)
  @gists ||= ApiFactory.new('Gists', current_options.merge(options), &block)
end

- (Object) git_data(options = {}, &block) Also known as: git

The Git Database API gives you access to read and write raw Git objects to your Git database on GitHub and to list and update your references (branch heads and tags).



29
30
31
# File 'lib/github_api/client.rb', line 29

def git_data(options={}, &block)
  @git_data ||= ApiFactory.new('GitData', current_options.merge(options), &block)
end

- (Object) gitignore(options = {}, &block) Also known as: git_ignore



21
22
23
# File 'lib/github_api/client.rb', line 21

def gitignore(options={}, &block)
  @gitignore ||= ApiFactory.new('Gitignore', current_options.merge(options), &block)
end

- (Object) issues(options = {}, &block)



34
35
36
# File 'lib/github_api/client.rb', line 34

def issues(options={}, &block)
  @issues ||= ApiFactory.new('Issues', current_options.merge(options), &block)
end

- (Object) markdown(options = {}, &block)



38
39
40
# File 'lib/github_api/client.rb', line 38

def markdown(options={}, &block)
  @markdown ||= ApiFactory.new('Markdown', current_options.merge(options), &block)
end

- (Object) meta(options = {}, &block)



42
43
44
# File 'lib/github_api/client.rb', line 42

def meta(options={}, &block)
  @meta ||= ApiFactory.new('Meta', current_options.merge(options), &block)
end

- (Object) oauth(options = {}, &block) Also known as: authorizations

An API for users to manage their own tokens. You can only access your own tokens, and only through Basic Authentication.



48
49
50
# File 'lib/github_api/client.rb', line 48

def oauth(options={}, &block)
  @oauth ||= ApiFactory.new('Authorizations', current_options.merge(options), &block)
end

- (Object) octocat(options = {}, &block)



68
69
70
# File 'lib/github_api/client.rb', line 68

def octocat(options={}, &block)
  @octocat ||= ApiFactory.new('Say', current_options.merge(options), &block)
end

- (Object) orgs(options = {}, &block) Also known as: organizations



53
54
55
# File 'lib/github_api/client.rb', line 53

def orgs(options={}, &block)
  @orgs ||= ApiFactory.new('Orgs', current_options.merge(options), &block)
end

- (Object) pull_requests(options = {}, &block) Also known as: pulls



58
59
60
# File 'lib/github_api/client.rb', line 58

def pull_requests(options={}, &block)
  @pull_requests ||= ApiFactory.new('PullRequests', current_options.merge(options), &block)
end

- (Object) repos(options = {}, &block) Also known as: repositories



63
64
65
# File 'lib/github_api/client.rb', line 63

def repos(options={}, &block)
  @repos ||= ApiFactory.new('Repos', current_options.merge(options), &block)
end

- (Object) scopes(options = {}, &block)



72
73
74
# File 'lib/github_api/client.rb', line 72

def scopes(options={}, &block)
  @scopes ||= ApiFactory.new('Scopes', current_options.merge(options), &block)
end

- (Object) search(options = {}, &block)



76
77
78
# File 'lib/github_api/client.rb', line 76

def search(options={}, &block)
  @search ||= ApiFactory.new('Search', current_options.merge(options), &block)
end

- (Object) users(options = {}, &block)

Many of the resources on the users API provide a shortcut for getting information about the currently authenticated user.



83
84
85
# File 'lib/github_api/client.rb', line 83

def users(options={}, &block)
  @users ||= ApiFactory.new('Users', current_options.merge(options), &block)
end