Class: Referly::RewardProxy
- Inherits:
-
Object
- Object
- Referly::RewardProxy
- Defined in:
- lib/referly/reward_proxy.rb
Instance Method Summary collapse
- #all(params = {}) ⇒ Object
- #create(params = {}) ⇒ Object
-
#initialize(client) ⇒ RewardProxy
constructor
A new instance of RewardProxy.
Constructor Details
#initialize(client) ⇒ RewardProxy
Returns a new instance of RewardProxy.
3 4 5 |
# File 'lib/referly/reward_proxy.rb', line 3 def initialize(client) @client = client end |
Instance Method Details
#all(params = {}) ⇒ Object
7 8 9 |
# File 'lib/referly/reward_proxy.rb', line 7 def all(params={}) @client.get('/rewards', params).parsed_response end |
#create(params = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/referly/reward_proxy.rb', line 11 def create(params={}) params[:earned_on] ||= Time.now.strftime('%F') params[:payable_on] ||= (Time.now + 2592000).strftime('%F') @client.post('/rewards', params).parsed_response end |