Class: Ghee
- Inherits:
-
Object
- Object
- Ghee
- Includes:
- API::Authorizations, API::Events, API::Gists, API::Orgs, API::Repos, API::Users
- Defined in:
- lib/ghee.rb,
lib/ghee/version.rb,
lib/ghee/api/keys.rb,
lib/ghee/api/orgs.rb,
lib/ghee/api/forks.rb,
lib/ghee/api/gists.rb,
lib/ghee/api/hooks.rb,
lib/ghee/api/repos.rb,
lib/ghee/api/users.rb,
lib/ghee/api/emails.rb,
lib/ghee/api/events.rb,
lib/ghee/api/issues.rb,
lib/ghee/api/labels.rb,
lib/ghee/connection.rb,
lib/ghee/api/commits.rb,
lib/ghee/api/git_data.rb,
lib/ghee/api/watchers.rb,
lib/ghee/api/downloads.rb,
lib/ghee/api/followers.rb,
lib/ghee/state_methods.rb,
lib/ghee/api/milestones.rb,
lib/ghee/resource_proxy.rb,
lib/ghee/api/collaborators.rb,
lib/ghee/api/authorizations.rb
Defined Under Namespace
Modules: API, CUD Classes: Connection, ResourceProxy
Constant Summary collapse
- VERSION =
"0.9.0"
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Class Method Summary collapse
- .access_token(token) ⇒ Object
- .basic_auth(user_name, password) ⇒ Object
- .create_token(user_name, password, scopes) ⇒ Object
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Ghee
constructor
Instantiates Ghee, accepts an access_token for authenticated access.
Methods included from API::Orgs
Methods included from API::Repos
Methods included from API::Events
Methods included from API::Users
Methods included from API::Gists
Methods included from API::Authorizations
Constructor Details
#initialize(options = {}) ⇒ Ghee
Instantiates Ghee, accepts an access_token for authenticated access
Access_token - String of the access_token
41 42 43 |
# File 'lib/ghee.rb', line 41 def initialize( = {}) @connection = Ghee::Connection.new() end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
27 28 29 |
# File 'lib/ghee.rb', line 27 def connection @connection end |
Class Method Details
.access_token(token) ⇒ Object
49 50 51 |
# File 'lib/ghee.rb', line 49 def self.access_token(token) Ghee.new :access_token => token end |
.basic_auth(user_name, password) ⇒ Object
45 46 47 |
# File 'lib/ghee.rb', line 45 def self.basic_auth(user_name, password) Ghee.new :basic_auth => {:user_name => user_name, :password => password} end |
.create_token(user_name, password, scopes) ⇒ Object
53 54 55 56 57 |
# File 'lib/ghee.rb', line 53 def self.create_token(user_name, password, scopes) auth = Ghee.basic_auth(user_name, password)..create({ :scopes => scopes}) auth["token"] end |