Class: Sendly::EnterpriseCreditsSubResource
- Inherits:
-
Object
- Object
- Sendly::EnterpriseCreditsSubResource
- Defined in:
- lib/sendly/enterprise.rb
Instance Method Summary collapse
- #deposit(amount:, description: nil) ⇒ Object
- #get ⇒ Object
-
#initialize(client) ⇒ EnterpriseCreditsSubResource
constructor
A new instance of EnterpriseCreditsSubResource.
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
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 |
#get ⇒ Object
346 347 348 |
# File 'lib/sendly/enterprise.rb', line 346 def get @client.get("/enterprise/credits") end |