Class: Twilio::REST::Api::V2010::AccountContext::BalanceList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/balance.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil) ⇒ BalanceList

Initialize the BalanceList

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String) (defaults to: nil)

    The unique SID identifier of the Account.


20
21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 20

def initialize(version, account_sid: nil)
  super(version)

  # Path Solution
  @solution = {account_sid: }
  @uri = "/Accounts/#{@solution[:account_sid]}/Balance.json"
end

Instance Method Details

#fetchBalanceInstance

Fetch the BalanceInstance

Returns:


31
32
33
34
35
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 31

def fetch
  payload = @version.fetch('GET', @uri)

  BalanceInstance.new(@version, payload, account_sid: @solution[:account_sid], )
end

#to_sObject

Provide a user friendly representation


39
40
41
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 39

def to_s
  '#<Twilio.Api.V2010.BalanceList>'
end