Module: Vidibus::Encoder
- Extended by:
- Encoder
- Included in:
- Encoder
- Defined in:
- lib/vidibus/encoder.rb,
lib/vidibus/encoder/base.rb,
lib/vidibus/encoder/version.rb,
lib/vidibus/encoder/util/tmp.rb,
lib/vidibus/encoder/util/flags.rb,
lib/vidibus/encoder/util/input.rb,
lib/vidibus/encoder/helper/base.rb,
lib/vidibus/encoder/util/output.rb,
lib/vidibus/encoder/helper/flags.rb,
lib/vidibus/encoder/helper/tools.rb,
lib/vidibus/encoder/util/profile.rb,
lib/vidibus/encoder/util/profiles.rb
Defined Under Namespace
Modules: Helper, Util Classes: Base, ConfigurationError, DataError, Error, FlagError, InputError, OutputError, ProcessingError, ProfileError, RecipeError
Constant Summary collapse
- VERSION =
'0.2.2'
Instance Attribute Summary collapse
-
#formats ⇒ Object
Returns the value of attribute formats.
Instance Method Summary collapse
-
#logger ⇒ Object
Return the custom or standard logger.
-
#logger=(instance) ⇒ Object
Set a custom logger instance.
-
#register_format(name, processor) ⇒ Object
Register a new encoder format.
Instance Attribute Details
#formats ⇒ Object
Returns the value of attribute formats.
19 20 21 |
# File 'lib/vidibus/encoder.rb', line 19 def formats @formats end |
Instance Method Details
#logger ⇒ Object
Return the custom or standard logger. If Rails is around, Rails.logger will be used by default.
34 35 36 37 38 |
# File 'lib/vidibus/encoder.rb', line 34 def logger @logger ||= begin defined?(Rails) ? Rails.logger : Logger.new(STDOUT) end end |
#logger=(instance) ⇒ Object
Set a custom logger instance.
41 42 43 |
# File 'lib/vidibus/encoder.rb', line 41 def logger=(instance) @logger = instance end |
#register_format(name, processor) ⇒ Object
Register a new encoder format.
23 24 25 26 27 28 29 |
# File 'lib/vidibus/encoder.rb', line 23 def register_format(name, processor) unless processor.new.is_a?(Vidibus::Encoder::Base) raise(ArgumentError, 'The processor must inherit Vidibus::Encoder::Base') end @formats ||= {} @formats[name] = processor end |