Class: RShade::EventProcessor
Overview
nodoc
Instance Attribute Summary collapse
-
#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.
6 7 8 9 10 |
# File 'lib/rshade/event_processor.rb', line 6 def initialize(store, config) @store = store custom_serializers = config.custom_serializers @var_serializer = ::RShade::Serializer::Traversal.new(custom_serializers) end |
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
4 5 6 |
# File 'lib/rshade/event_processor.rb', line 4 def store @store end |
Instance Method Details
#enter(event, level) ⇒ Object
14 15 16 17 |
# File 'lib/rshade/event_processor.rb', line 14 def enter(event, level) event.with_serialized_vars!(@var_serializer).with_level!(level) store.add(event, level) end |
#leave(event, level) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/rshade/event_processor.rb', line 21 def leave(event, level) store.current! do |node| node.value.set_return_value!(event.return_value) .with_serialized_return!(->(value) { value.inspect }) end rescue => e # 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
32 33 34 |
# File 'lib/rshade/event_processor.rb', line 32 def other(event, level) end |