Class: Sendly::EnterpriseCreditsSubResource

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/enterprise.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ EnterpriseCreditsSubResource

Returns a new instance of EnterpriseCreditsSubResource.



394
395
396
# File 'lib/sendly/enterprise.rb', line 394

def initialize(client)
  @client = client
end

Instance Method Details

#deposit(amount:, description: nil) ⇒ Object

Raises:

  • (ArgumentError)


402
403
404
405
406
407
408
409
# File 'lib/sendly/enterprise.rb', line 402

def deposit(amount:, description: nil)
  raise ArgumentError, "Amount must be a positive number" if !amount.is_a?(Integer) || amount <= 0

  body = { amount: amount }
  body[:description] = description if description

  @client.post("/enterprise/credits/deposit", body)
end

#getObject



398
399
400
# File 'lib/sendly/enterprise.rb', line 398

def get
  @client.get("/enterprise/credits")
end