Class: MkvToolNix::Types::Merge::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/mkvtoolnix/types/merge/attachment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8

def description
  @description
end

#fileObject (readonly)

Returns the value of attribute file.



8
9
10
# File 'lib/mkvtoolnix/types/merge/attachment.rb', line 8

def file
  @file
end

#mime_typeObject (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

#nameObject (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