Method: Refile.processor
- Defined in:
- lib/refile.rb
.processor(name, processor = nil) {|Refile::File| ... }
This method returns an undefined value.
Adds a processor. The processor must respond to call, both receiving
and returning an IO-like object. Alternatively a block can be given to
this method which also receives and returns an IO-like object.
An IO-like object is recommended to be an instance of the IO class or
one of its subclasses, like File or a StringIO, or a Refile::File.
It can also be any other object which responds to size, read, eof?
and close and mimics the behaviour of IO objects for these methods.
129 130 131 132 |
# File 'lib/refile.rb', line 129 def processor(name, processor = nil, &block) processor ||= block processors[name.to_s] = processor end |