Class: GreenGoose::Client
- Inherits:
-
Object
- Object
- GreenGoose::Client
- Extended by:
- Forwardable
- Defined in:
- lib/greengoose/client.rb
Overview
Green Goose API client
Constant Summary collapse
- API_URL =
"http://api.greengoose.com"
- API_VERSION =
1
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Instance Method Summary collapse
- #actions ⇒ Object
-
#authenticate(username, password) ⇒ Object
Authenticates against the API using a username and password.
-
#initialize ⇒ Client
constructor
Creates a new API client.
- #stats ⇒ Object
Constructor Details
#initialize ⇒ Client
Creates a new API client
18 19 |
# File 'lib/greengoose/client.rb', line 18 def initialize end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
12 13 14 |
# File 'lib/greengoose/client.rb', line 12 def credentials @credentials end |
Instance Method Details
#actions ⇒ Object
32 33 34 |
# File 'lib/greengoose/client.rb', line 32 def actions GreenGoose::ActionCollection.new(self) end |
#authenticate(username, password) ⇒ Object
Authenticates against the API using a username and password
25 26 27 28 29 30 |
# File 'lib/greengoose/client.rb', line 25 def authenticate(username, password) @credentials = Credentials::Basic.new(username, password) @credentials.configure_connection(connection) self end |
#stats ⇒ Object
36 37 38 |
# File 'lib/greengoose/client.rb', line 36 def stats GreenGoose::StatCollection.new(self) end |