Class: Twilio::REST::Sync::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/sync/v1.rb,
lib/twilio-ruby/rest/sync/v1/service.rb,
lib/twilio-ruby/rest/sync/v1/service/document.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb,
lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb,
lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.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 Sync


15
16
17
18
19
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 15

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

Instance Method Details

#services(sid = :unset) ⇒ Twilio::REST::Sync::V1::ServiceContext, Twilio::REST::Sync::V1::ServiceList

Parameters:

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

    The SID of the Service resource to fetch.

Returns:


25
26
27
28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 25

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

#to_sObject

Provide a user friendly representation


38
39
40
# File 'lib/twilio-ruby/rest/sync/v1.rb', line 38

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