Class: Miniatura::GenerateCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/miniatura/generate_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(in_path, out_path) ⇒ GenerateCommand

Returns a new instance of GenerateCommand.



6
7
8
9
# File 'lib/miniatura/generate_command.rb', line 6

def initialize(in_path, out_path)
  @input_path = in_path
  @output_path = out_path
end

Instance Attribute Details

#input_pathObject (readonly)

Returns the value of attribute input_path.



4
5
6
# File 'lib/miniatura/generate_command.rb', line 4

def input_path
  @input_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



4
5
6
# File 'lib/miniatura/generate_command.rb', line 4

def output_path
  @output_path
end

Instance Method Details

#generate_command(options = {}) ⇒ Object

Generates ffmpeg command to create the thumbnail.



12
13
14
15
# File 'lib/miniatura/generate_command.rb', line 12

def generate_command(options = {})
  options = Miniatura::Options.new(options)
  %Q(ffmpeg #{options.to_options} #{output_path} -i #{input_path})
end