Class: CarrierWave::Video::Thumbnailer::Options
- Inherits:
-
Hash
- Object
- Hash
- CarrierWave::Video::Thumbnailer::Options
- Defined in:
- lib/carrierwave/video/thumbnailer/ffmpegthumbnailer/options.rb
Overview
Options to be be converted to CLI parameters
Constant Summary collapse
- BOOLEAN =
[ :square, :strip, :workaround ]
Instance Method Summary collapse
-
#initialize(opts) ⇒ Options
constructor
A new instance of Options.
- #to_cli ⇒ Object
Constructor Details
#initialize(opts) ⇒ Options
Returns a new instance of Options.
14 15 16 |
# File 'lib/carrierwave/video/thumbnailer/ffmpegthumbnailer/options.rb', line 14 def initialize opts opts.each { |k, v| self[k] = v} end |
Instance Method Details
#to_cli ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/carrierwave/video/thumbnailer/ffmpegthumbnailer/options.rb', line 18 def to_cli self.map do |k, v| if BOOLEAN.include? k cli_key k if v else "#{cli_key k} #{cli_val v}" end end.join(' ') end |