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.



342
343
344
# File 'lib/sendly/enterprise.rb', line 342

def initialize(client)
  @client = client
end

Instance Method Details

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

Raises:

  • (ArgumentError)


350
351
352
353
354
355
356
357
# File 'lib/sendly/enterprise.rb', line 350

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



346
347
348
# File 'lib/sendly/enterprise.rb', line 346

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