Class: Twilio::REST::Fax::V1::FaxContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Fax::V1::FaxContext
- Defined in:
- lib/twilio-ruby/rest/fax/v1/fax.rb,
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.
Defined Under Namespace
Classes: FaxMediaContext, FaxMediaInstance, FaxMediaList, FaxMediaPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the FaxInstance.
-
#fetch ⇒ FaxInstance
Fetch the FaxInstance.
-
#initialize(version, sid) ⇒ FaxContext
constructor
Initialize the FaxContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#media(sid = :unset) ⇒ FaxMediaList, FaxMediaContext
Access the media.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ FaxContext
Initialize the FaxContext
202 203 204 205 206 207 208 209 210 211 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 202 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Faxes/#{@solution[:sid]}" # Dependents @media = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the FaxInstance
225 226 227 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 225 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ FaxInstance
Fetch the FaxInstance
216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 216 def fetch payload = @version.fetch('GET', @uri) FaxInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
256 257 258 259 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 256 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Fax.V1.FaxContext #{context}>" end |
#media(sid = :unset) ⇒ FaxMediaList, FaxMediaContext
Access the media
233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 233 def media(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return FaxMediaContext.new(@version, @solution[:sid], sid, ) end unless @media @media = FaxMediaList.new(@version, fax_sid: @solution[:sid], ) end @media end |
#to_s ⇒ Object
Provide a user friendly representation
249 250 251 252 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 249 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Fax.V1.FaxContext #{context}>" end |