Class: Mail2FrontMatter::PreProcessor
- Inherits:
-
Object
- Object
- Mail2FrontMatter::PreProcessor
show all
- Defined in:
- lib/mail2frontmatter/preprocessor.rb
Defined Under Namespace
Classes: InvalidProcessor
Constant Summary
collapse
- @@processors =
Set.new
Class Method Summary
collapse
Class Method Details
.process(metadata, body) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/mail2frontmatter/preprocessor.rb', line 20
def self.process(metadata, body)
@@processors.each do |processor|
metadata, body = processor.run(metadata, body)
end
return metadata, body
end
|
.register(options = {}) ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/mail2frontmatter/preprocessor.rb', line 12
def self.register(options = {})
raise InvalidProcessor, "run method not defined on #{self}" if !self.respond_to?(:run)
raise ArgumentError, "options must be a hash" unless options.is_a? Hash
@options = options
@@processors << self
end
|