Class: Referly::RewardProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/referly/reward_proxy.rb

Instance Method Summary collapse

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