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.
8 9 10 |
# File 'lib/referly/client.rb', line 8 def initialize(key, secret) @auth = { username: key, password: secret } end |
Instance Method Details
#accounts ⇒ Object
20 21 22 |
# File 'lib/referly/client.rb', line 20 def accounts Referly::AccountProxy.new(self) end |
#get(path, params) ⇒ Object
16 17 18 |
# File 'lib/referly/client.rb', line 16 def get(path, params) self.class.get(path, query: params, basic_auth: @auth) end |
#links ⇒ Object
24 25 26 |
# File 'lib/referly/client.rb', line 24 def links Referly::LinkProxy.new(self) end |
#post(path, params) ⇒ Object
12 13 14 |
# File 'lib/referly/client.rb', line 12 def post(path, params) self.class.post(path, body: params, basic_auth: @auth) end |
#rewards ⇒ Object
28 29 30 |
# File 'lib/referly/client.rb', line 28 def rewards Referly::RewardProxy.new(self) end |