Class: Twilio::REST::Fax::V1::FaxContext::FaxMediaContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/fax/v1/fax/fax_media.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, fax_sid, sid) ⇒ FaxMediaContext

Initialize the FaxMediaContext

Parameters:

  • version (Version)

    Version that contains the resource

  • fax_sid (String)

    The SID of the fax with the FaxMedia resource to fetch.

  • sid (String)

    The Twilio-provided string that uniquely identifies the FaxMedia resource to fetch.


159
160
161
162
163
164
165
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 159

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

  # Path Solution
  @solution = {fax_sid: fax_sid, sid: sid, }
  @uri = "/Faxes/#{@solution[:fax_sid]}/Media/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the FaxMediaInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


179
180
181
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 179

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

#fetchFaxMediaInstance

Fetch the FaxMediaInstance

Returns:


170
171
172
173
174
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 170

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

  FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


192
193
194
195
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 192

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

#to_sObject

Provide a user friendly representation


185
186
187
188
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 185

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