lib/raconteur/processor.rb in raconteur-0.1.1 vs lib/raconteur/processor.rb in raconteur-0.2.0
- old
+ new
@@ -1,15 +1,15 @@
class Raconteur::Processor
DEFAULTS = {
tag: nil,
template: nil,
handler: nil,
- settings: {}
+ payload: nil
}.freeze
ATTRS = DEFAULTS.keys.freeze
- # register new processor by providing a tag name + any settings (optional)
+ # register new processor by providing a tag name + any payload (optional)
def self.register!(tag, customizations={})
if find(tag)
raise 'Processor already exists!'
else
all << Raconteur::Processor.new(tag, customizations)
@@ -72,9 +72,10 @@
@data = Marshal.load(Marshal.dump(DEFAULTS))
@processor = self
@processor.tag = tag
@processor.template = customizations[:template] if customizations[:template].is_a?(String)
@processor.handler = customizations[:handler] if customizations[:handler].is_a?(Proc)
+ @processor.payload = customizations[:payload] if customizations.has_key?(:payload)
@processor
end
# prettier print
def inspect