Class: FFmpeg::FilterGraph::Filter
- Inherits:
-
Object
- Object
- FFmpeg::FilterGraph::Filter
- Includes:
- Utils::Strings
- 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
Methods included from Utils::Strings
Class Method Details
.name(name = nil) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 7 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
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 16 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
44 45 46 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 44 def empty! self.class..each { |opt| send("#{opt}=", nil) } end |
#options ⇒ Hash<String,String>
values will not be included.
50 51 52 53 54 55 56 57 58 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 50 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.
39 40 41 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 39 def (*.keys) end |
#to_s ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/ffmpeg/filter_graph/filter.rb', line 29 def to_s if .any? "#{self.class.name}=#{}" else self.class.name end end |