Class: Referly::Client
- Inherits:
-
Object
- Object
- Referly::Client
- Includes:
- HTTParty
- Defined in:
- lib/referly/client.rb
Instance Method Summary collapse
- #accounts ⇒ Object
- #get(path, params) ⇒ Object
-
#initialize(key, secret) ⇒ Client
constructor
A new instance of Client.
- #links ⇒ Object
- #post(path, params) ⇒ Object
- #rewards ⇒ Object
Constructor Details
#initialize(key, secret) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/referly/client.rb', line 9 def initialize(key, secret) @auth = { username: key, password: secret } end |
Instance Method Details
#accounts ⇒ Object
21 22 23 |
# File 'lib/referly/client.rb', line 21 def accounts Referly::AccountProxy.new(self) end |
#get(path, params) ⇒ Object
17 18 19 |
# File 'lib/referly/client.rb', line 17 def get(path, params) self.class.get(path, query: params, basic_auth: @auth) end |
#links ⇒ Object
25 26 27 |
# File 'lib/referly/client.rb', line 25 def links Referly::LinkProxy.new(self) end |
#post(path, params) ⇒ Object
13 14 15 |
# File 'lib/referly/client.rb', line 13 def post(path, params) self.class.post(path, body: params, basic_auth: @auth) end |
#rewards ⇒ Object
29 30 31 |
# File 'lib/referly/client.rb', line 29 def rewards Referly::RewardProxy.new(self) end |