Class: Twilio::REST::Pricing::V1::VoiceList

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/pricing/v1/voice.rb,
lib/twilio-ruby/rest/pricing/v1/voice/number.rb,
lib/twilio-ruby/rest/pricing/v1/voice/country.rb

Defined Under Namespace

Classes: CountryContext, CountryInstance, CountryList, CountryPage, NumberContext, NumberInstance, NumberList, NumberPage

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VoiceList

Initialize the VoiceList

Parameters:

  • version (Version)

    Version that contains the resource



16
17
18
19
20
21
22
23
24
25
# File 'lib/twilio-ruby/rest/pricing/v1/voice.rb', line 16

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}

  # Components
  @numbers = nil
  @countries = nil
end

Instance Method Details

#countries(iso_country = :unset) ⇒ CountryList, CountryContext

Access the countries

Parameters:

  • iso_country (String) (defaults to: :unset)

    The iso_country

Returns:

Raises:

  • (ArgumentError)


52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/pricing/v1/voice.rb', line 52

def countries(iso_country=:unset)
  raise ArgumentError, 'iso_country cannot be nil' if iso_country.nil?

  if iso_country != :unset
    return CountryContext.new(
        @version,
        iso_country,
    )
  end

    @countries ||= CountryList.new(
        @version,
    )
end

#numbers(number = :unset) ⇒ NumberList, NumberContext

Access the numbers

Parameters:

  • number (String) (defaults to: :unset)

    The number

Returns:

Raises:

  • (ArgumentError)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/twilio-ruby/rest/pricing/v1/voice.rb', line 32

def numbers(number=:unset)
  raise ArgumentError, 'number cannot be nil' if number.nil?

  if number != :unset
    return NumberContext.new(
        @version,
        number,
    )
  end

    @numbers ||= NumberList.new(
        @version,
    )
end

#to_sObject

Provide a user friendly representation



69
70
71
# File 'lib/twilio-ruby/rest/pricing/v1/voice.rb', line 69

def to_s
  '#<Twilio.Pricing.V1.VoiceList>'
end