Class: RShade::EventProcessor
Overview
nodoc
Instance Attribute Summary collapse
-
#serializer ⇒ Object
readonly
Returns the value of attribute serializer.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #enter(event, level) ⇒ Object
-
#initialize(store, config) ⇒ EventProcessor
constructor
A new instance of EventProcessor.
- #leave(event, _level) ⇒ Object
- #other(event, level) ⇒ Object
Constructor Details
#initialize(store, config) ⇒ EventProcessor
Returns a new instance of EventProcessor.
8 9 10 11 12 |
# File 'lib/rshade/event_processor.rb', line 8 def initialize(store, config) @store = store custom_serializers = config.variable_serializer @serializer = ::RShade::Serializer::Traversal.new(custom_serializers) end |
Instance Attribute Details
#serializer ⇒ Object (readonly)
Returns the value of attribute serializer.
6 7 8 |
# File 'lib/rshade/event_processor.rb', line 6 def serializer @serializer end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
6 7 8 |
# File 'lib/rshade/event_processor.rb', line 6 def store @store end |
Instance Method Details
#enter(event, level) ⇒ Object
16 17 18 19 |
# File 'lib/rshade/event_processor.rb', line 16 def enter(event, level) event.with_serialized_vars!(serializer).with_level!(level) store.add(event, level) end |
#leave(event, _level) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/rshade/event_processor.rb', line 23 def leave(event, _level) store.current! do |node| node.value.return_value!(event.return_value) .with_serialized_return!(serializer) end rescue StandardError # this rescue here due this issue which reproduce in ruby-2.6.6 at least # https://bugs.ruby-lang.org/issues/18060 end |
#other(event, level) ⇒ Object
35 |
# File 'lib/rshade/event_processor.rb', line 35 def other(event, level); end |