Class: Twilio::REST::Events::V1::EventTypeContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/events/v1/event_type.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, type) ⇒ EventTypeContext

Initialize the EventTypeContext

Parameters:

  • version (Version)

    Version that contains the resource

  • type (String)

    A string that uniquely identifies this Event Type.


161
162
163
164
165
166
167
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 161

def initialize(version, type)
  super(version)

  # Path Solution
  @solution = {type: type, }
  @uri = "/Types/#{@solution[:type]}"
end

Instance Method Details

#fetchEventTypeInstance

Fetch the EventTypeInstance

Returns:


172
173
174
175
176
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 172

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

  EventTypeInstance.new(@version, payload, type: @solution[:type], )
end

#inspectObject

Provide a detailed, user friendly representation


187
188
189
190
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 187

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

#to_sObject

Provide a user friendly representation


180
181
182
183
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 180

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