Class: Rev::Attachment
- Inherits:
-
ApiSerializable
- Object
- ApiSerializable
- Rev::Attachment
- Defined in:
- lib/rev-api/models/order.rb
Overview
Represents order attachment - logical document associated with order
Constant Summary collapse
- KINDS =
{ :transcript => 'transcript', :caption => 'caption', :media => 'media' }
- REPRESENTATIONS =
List of supported mime-types used to request attachment’s content within ‘Accept’ header
{ # Supported by :transcript :docx => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', :pdf => 'application/pdf', :txt => 'text/plain', :youtube => 'text/plain; format=youtube-transcript', # Supported by :caption :srt => 'application/x-subrip', :scc => 'text/x-scc', :mcc => 'text/x-mcc', :ttml => 'application/ttml+xml', :qt => 'application/x-quicktime-timedtext', :vtt => 'text/vtt', :dfxp => 'application/ttaf+xml', :cap => 'application/x-cheetah-cap', :stl => 'text/x-stl', :avidds => 'text/vnd.avid-ds' }
Instance Attribute Summary collapse
-
#audio_length_seconds ⇒ Object
readonly
Returns the value of attribute audio_length_seconds.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#video_length_seconds ⇒ Object
readonly
Returns the value of attribute video_length_seconds.
Class Method Summary collapse
-
.representation_mime(ext) ⇒ String
Mime-type for requested extension.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Attachment
constructor
A new instance of Attachment.
Methods inherited from ApiSerializable
Constructor Details
#initialize(fields) ⇒ Attachment
Returns a new instance of Attachment.
102 103 104 105 |
# File 'lib/rev-api/models/order.rb', line 102 def initialize(fields) super fields @links = fields['links'].map { |link_fields| Link.new(link_fields) } end |
Instance Attribute Details
#audio_length_seconds ⇒ Object (readonly)
Returns the value of attribute audio_length_seconds.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def audio_length_seconds @audio_length_seconds end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def kind @kind end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def links @links end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def name @name end |
#video_length_seconds ⇒ Object (readonly)
Returns the value of attribute video_length_seconds.
71 72 73 |
# File 'lib/rev-api/models/order.rb', line 71 def video_length_seconds @video_length_seconds end |
Class Method Details
.representation_mime(ext) ⇒ String
Returns mime-type for requested extension.
109 110 111 |
# File 'lib/rev-api/models/order.rb', line 109 def self.representation_mime(ext) REPRESENTATIONS[ext] end |