Class: Twilio::REST::IpMessaging::V2::ServiceContext::BindingContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, sid) ⇒ BindingContext

Initialize the BindingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The service_sid

  • sid (String)

    The sid


164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb', line 164

def initialize(version, service_sid, sid)
  super(version)

  # Path Solution
  @solution = {service_sid: service_sid, sid: sid, }
  @uri = "/Services/#{@solution[:service_sid]}/Bindings/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the BindingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


184
185
186
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb', line 184

def delete
   @version.delete('DELETE', @uri)
end

#fetchBindingInstance

Fetch the BindingInstance

Returns:


175
176
177
178
179
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb', line 175

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

  BindingInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


197
198
199
200
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb', line 197

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.IpMessaging.V2.BindingContext #{context}>"
end

#to_sObject

Provide a user friendly representation


190
191
192
193
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb', line 190

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.IpMessaging.V2.BindingContext #{context}>"
end