Class: FFmpeg::FilterGraph::Filter
- Inherits:
-
Object
- Object
- FFmpeg::FilterGraph::Filter
- Defined in:
- lib/ffmpeg/filter_graph/filter.rb
Class Method Summary collapse
- .name(name = nil) ⇒ Object
- .option(*opts) ⇒ Object (also: options)
Instance Method Summary collapse
-
#empty! ⇒ Object
Set all options to nil.
-
#options ⇒ Hash<String,String>
values will not be included.
-
#options_string ⇒ String
A string concatenating the set options.
- #to_s ⇒ Object
Class Method Details
.name(name = nil) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 5 def name(name = nil) if name.nil? @name || fail('filter name not set') else @name = name end end |
.option(*opts) ⇒ Object Also known as: options
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 14 def option(*opts) @opts ||= [] if opts.any? @opts.concat(opts) attr_accessor *opts end @opts end |
Instance Method Details
#empty! ⇒ Object
Set all options to nil
42 43 44 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 42 def empty! self.class..each { |opt| send("#{opt}=", nil) } end |
#options ⇒ Hash<String,String>
values will not be included.
48 49 50 51 52 53 54 55 56 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 48 def ret = {} self.class..each do |opt| if (val = self.send(opt)) ret[opt] = val end end ret end |
#options_string ⇒ String
Note:
May be overridden by atypical filters
Returns A string concatenating the set options.
37 38 39 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 37 def (*.keys) end |
#to_s ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 27 def to_s if .any? "#{self.class.name}=#{options_string}" else self.class.name end end |