Class: Learndot::TrainingCredits

Inherits:
Object
  • Object
show all
Defined in:
lib/learndot/training_credits.rb

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ TrainingCredits

Returns a new instance of TrainingCredits.



2
3
4
# File 'lib/learndot/training_credits.rb', line 2

def initialize(api)
  @api = api
end

Instance Method Details

#adjust(tc_account_id, conditions) ⇒ Object



14
15
16
# File 'lib/learndot/training_credits.rb', line 14

def adjust(, conditions)
  api_post("credit/#{tc_account_id}/adjust", conditions)
end

#create_account(conditions) ⇒ Object



10
11
12
# File 'lib/learndot/training_credits.rb', line 10

def (conditions)
  api_post('/credit', conditions)
end

#find_accounts(email) ⇒ Object



6
7
8
# File 'lib/learndot/training_credits.rb', line 6

def find_accounts(email)
  api_get('/credit', {email: email})
end

#history(tc_account_id) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/learndot/training_credits.rb', line 18

def history()
  endpoint = "/credit/#{tc_account_id}/transactions"

  page do |count|
    api_get(endpoint, {page: count})
  end
end