Class: Ghee
- Inherits:
-
Object
- Object
- Ghee
- Includes:
- API::Authorizations, API::Events, API::Gists, API::Issues, API::Milestones, API::Orgs, API::Repos, API::Users
- Defined in:
- lib/ghee.rb,
lib/ghee/version.rb,
lib/ghee/api/orgs.rb,
lib/ghee/api/gists.rb,
lib/ghee/api/repos.rb,
lib/ghee/api/users.rb,
lib/ghee/api/events.rb,
lib/ghee/api/issues.rb,
lib/ghee/connection.rb,
lib/ghee/api/git_data.rb,
lib/ghee/api/downloads.rb,
lib/ghee/state_methods.rb,
lib/ghee/api/milestones.rb,
lib/ghee/resource_proxy.rb,
lib/ghee/api/authorizations.rb
Defined Under Namespace
Modules: API, CUD Classes: Connection, ResourceProxy
Constant Summary collapse
- VERSION =
"0.8.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
34 35 36 |
# File 'lib/ghee.rb', line 34 def initialize( = {}) @connection = Ghee::Connection.new() end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
18 19 20 |
# File 'lib/ghee.rb', line 18 def connection @connection end |
Class Method Details
.access_token(token) ⇒ Object
42 43 44 |
# File 'lib/ghee.rb', line 42 def self.access_token(token) Ghee.new :access_token => token end |
.basic_auth(user_name, password) ⇒ Object
38 39 40 |
# File 'lib/ghee.rb', line 38 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
46 47 48 49 50 |
# File 'lib/ghee.rb', line 46 def self.create_token(user_name, password, scopes) auth = Ghee.basic_auth(user_name, password)..create({ :scopes => scopes}) auth["token"] end |