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', :translation => 'translation', :media => 'media' }
- REPRESENTATIONS =
List of supported mime-types used to request attachment’s content within ‘Accept’ header
{ :docx => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', :doc => 'application/msword', :pdf => 'application/pdf', :txt => 'text/plain', :youtube => 'text/plain; format=youtube-transcript' }
Instance Attribute Summary collapse
-
#audio_length ⇒ Object
readonly
Returns the value of attribute audio_length.
-
#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.
-
#word_count ⇒ Object
readonly
Returns the value of attribute word_count.
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.
86 87 88 89 |
# File 'lib/rev-api/models/order.rb', line 86 def initialize(fields) super fields @links = fields['links'].map { |link_fields| Link.new(link_fields) } end |
Instance Attribute Details
#audio_length ⇒ Object (readonly)
Returns the value of attribute audio_length.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def audio_length @audio_length end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def kind @kind end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def links @links end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def name @name end |
#word_count ⇒ Object (readonly)
Returns the value of attribute word_count.
67 68 69 |
# File 'lib/rev-api/models/order.rb', line 67 def word_count @word_count end |
Class Method Details
.representation_mime(ext) ⇒ String
Returns mime-type for requested extension.
93 94 95 |
# File 'lib/rev-api/models/order.rb', line 93 def self.representation_mime(ext) REPRESENTATIONS[ext] end |