Class: MkvToolNix::Types::Merge::Attachment
- Inherits:
-
Object
- Object
- MkvToolNix::Types::Merge::Attachment
- Defined in:
- lib/mkvtoolnix/types/merge/attachment.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_to_cmd(cmd) ⇒ Object
-
#initialize(file) ⇒ Attachment
constructor
A new instance of Attachment.
- #with_description(description) ⇒ Object
- #with_mime_type(type) ⇒ Object
- #with_name(name) ⇒ Object
Constructor Details
#initialize(file) ⇒ Attachment
Returns a new instance of Attachment.
25 26 27 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 25 def initialize(file) @file = file end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8 def description @description end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8 def file @file end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8 def name @name end |
Instance Method Details
#add_to_cmd(cmd) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 29 def add_to_cmd(cmd) unless @file.nil? cmd << '--attachment-description' << @description unless @description.nil? cmd << '--attachment-mime-type' << @mime_type unless @mime_type.nil? cmd << '--attachment-name' << @name unless @name.nil? cmd << '--attach-file' << @file end nil end |
#with_description(description) ⇒ Object
20 21 22 23 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 20 def with_description(description) @description = description self end |
#with_mime_type(type) ⇒ Object
10 11 12 13 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 10 def with_mime_type(type) @mime_type = type self end |
#with_name(name) ⇒ Object
15 16 17 18 |
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 15 def with_name(name) @name = name self end |