Sha256: 7516d6a8ee4b1a1b70bb77b38783fdea7a62ee93c582e40fe3e5ec7f9c6b2e17

Contents?: true

Size: 907 Bytes

Versions: 1

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

module MkvToolNix
  module Types
    module Merge
      class Attachment

        attr_reader :file, :mime_type, :name, :description

        def with_mime_type(type)
          @mime_type = type
          self
        end

        def with_name(name)
          @name = name
          self
        end

        def with_description(description)
          @description = description
          self
        end

        def initialize(file)
          @file = file
        end

        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
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mkvtoolnix-1.0.0 lib/mkvtoolnix/types/merge/attachment.rb