Class: Twilio::REST::Messaging::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1.rb,
lib/twilio-ruby/rest/messaging/v1/service.rb,
lib/twilio-ruby/rest/messaging/v1/service/short_code.rb,
lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb,
lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb

Defined Under Namespace

Classes: ServiceContext, ServiceInstance, ServiceList, ServicePage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Messaging



13
14
15
16
17
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 13

def initialize(domain)
  super
  @version = 'v1'
  @services = nil
end

Instance Method Details

#services(sid = :unset) ⇒ Twilio::REST::Messaging::V1::ServiceInstance, Twilio::REST::Messaging::V1::ServiceList

Parameters:

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

    The sid

Returns:



23
24
25
26
27
28
29
30
31
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 23

def services(sid=:unset)
  if sid.nil?
    raise ArgumentError, 'sid cannot be nil'
  elsif sid == :unset
    @services ||= ServiceList.new self
  else
    ServiceContext.new(self, sid)
  end
end

#to_sObject

Provide a user friendly representation



35
36
37
# File 'lib/twilio-ruby/rest/messaging/v1.rb', line 35

def to_s
  '<Twilio::REST::Messaging::V1>'
end