Class: Miniatura::GenerateCommand
- Inherits:
-
Object
- Object
- Miniatura::GenerateCommand
- Defined in:
- lib/miniatura/generate_command.rb
Instance Attribute Summary collapse
-
#input_path ⇒ Object
readonly
Returns the value of attribute input_path.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Instance Method Summary collapse
-
#generate_command(options = {}) ⇒ Object
Generates ffmpeg command to create the thumbnail.
-
#initialize(in_path, out_path) ⇒ GenerateCommand
constructor
A new instance of GenerateCommand.
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_path ⇒ Object (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_path ⇒ Object (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( = {}) = Miniatura::Options.new() %Q(ffmpeg #{options.to_options} #{output_path} -i #{input_path}) end |