Class: Learndot::TrainingCredits
- Inherits:
-
Object
- Object
- Learndot::TrainingCredits
- Defined in:
- lib/learndot/training_credits.rb
Instance Method Summary collapse
- #adjust(tc_account_id, conditions) ⇒ Object
- #create_account(conditions) ⇒ Object
- #find_accounts(email) ⇒ Object
- #history(tc_account_id) ⇒ Object
-
#initialize(api) ⇒ TrainingCredits
constructor
A new instance of TrainingCredits.
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(tc_account_id, 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 create_account(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(tc_account_id) endpoint = "/credit/#{tc_account_id}/transactions" page do |count| api_get(endpoint, {page: count}) end end |