Class: RShade::Config::EventStore
- Defined in:
- lib/rshade/config/event_store.rb
Constant Summary collapse
- DEFAULT_FORMATTER =
{ json: ::RShade::Formatter::Trace::Json, stdout: ::RShade::Formatter::Trace::Stdout }.freeze
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#tp_events ⇒ Object
readonly
Returns the value of attribute tp_events.
-
#variable_serializer ⇒ Object
readonly
Returns the value of attribute variable_serializer.
Class Method Summary collapse
Instance Method Summary collapse
- #exclude_gems! ⇒ Object
- #filter!(filter_type, &block) ⇒ Object
- #formatter!(formatter, opts = {}) ⇒ Object
-
#initialize(tp_events: %i[call return],, formatter: RShade::Formatter::Trace::Stdout.new, filter: default_filter_composition, serializers: {}) ⇒ EventStore
constructor
A new instance of EventStore.
- #serializer!(hash) ⇒ Object
- #tp_events!(tp_events) ⇒ Object
Constructor Details
#initialize(tp_events: %i[call return],, formatter: RShade::Formatter::Trace::Stdout.new, filter: default_filter_composition, serializers: {}) ⇒ EventStore
Returns a new instance of EventStore.
21 22 23 24 25 26 27 28 |
# File 'lib/rshade/config/event_store.rb', line 21 def initialize(tp_events: i[call return], formatter: RShade::Formatter::Trace::Stdout.new, filter: default_filter_composition, serializers: {}) @filter = filter @formatter = formatter @tp_events = tp_events @variable_serializer = serializers end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
6 7 8 |
# File 'lib/rshade/config/event_store.rb', line 6 def filter @filter end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
6 7 8 |
# File 'lib/rshade/config/event_store.rb', line 6 def formatter @formatter end |
#tp_events ⇒ Object (readonly)
Returns the value of attribute tp_events.
6 7 8 |
# File 'lib/rshade/config/event_store.rb', line 6 def tp_events @tp_events end |
#variable_serializer ⇒ Object (readonly)
Returns the value of attribute variable_serializer.
6 7 8 |
# File 'lib/rshade/config/event_store.rb', line 6 def variable_serializer @variable_serializer end |
Class Method Details
.default ⇒ Object
13 14 15 |
# File 'lib/rshade/config/event_store.rb', line 13 def self.default new.exclude_gems! end |
Instance Method Details
#exclude_gems! ⇒ Object
50 51 52 53 54 55 |
# File 'lib/rshade/config/event_store.rb', line 50 def exclude_gems! filter!(::RShade::Filter::ExcludePathFilter) do |paths| paths.concat(RShade::Utils.default_excluded_path) end self end |
#filter!(filter_type, &block) ⇒ Object
40 41 42 43 |
# File 'lib/rshade/config/event_store.rb', line 40 def filter!(filter_type, &block) filter.filter(filter_type, &block) self end |
#formatter!(formatter, opts = {}) ⇒ Object
45 46 47 48 |
# File 'lib/rshade/config/event_store.rb', line 45 def formatter!(formatter, opts = {}) @formatter = formatter.is_a?(Symbol) ? set_symbol_formatter(formatter, opts) : formatter self end |
#serializer!(hash) ⇒ Object
35 36 37 38 |
# File 'lib/rshade/config/event_store.rb', line 35 def serializer!(hash) variable_serializer.merge!(hash) self end |
#tp_events!(tp_events) ⇒ Object
30 31 32 33 |
# File 'lib/rshade/config/event_store.rb', line 30 def tp_events!(tp_events) @tp_events = tp_events self end |