Class: RShade::Config::Store
Instance Attribute Summary collapse
-
#custom_serializers ⇒ Object
readonly
Returns the value of attribute custom_serializers.
-
#filter_composition ⇒ Object
readonly
Returns the value of attribute filter_composition.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#tp_events ⇒ Object
readonly
Returns the value of attribute tp_events.
Instance Method Summary collapse
- #add_custom_serializers(hash) ⇒ Object
- #config_filter(filter_type, &block) ⇒ Object
-
#initialize(options = {}) ⇒ Store
constructor
A new instance of Store.
- #set_formatter(formatter) ⇒ Object
- #set_tp_events(tp_events) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Store
Returns a new instance of Store.
11 12 13 14 15 16 |
# File 'lib/rshade/config/store.rb', line 11 def initialize(={}) @filter_composition = .fetch(:filter_composition, default_filter_composition) @formatter = .fetch(:formatter, ::RShade::Formatter::Stdout) @tp_events = .fetch(:tp_events, [:call, :return]) @custom_serializers = .fetch(:custom_serializers, {}) end |
Instance Attribute Details
#custom_serializers ⇒ Object (readonly)
Returns the value of attribute custom_serializers.
5 6 7 |
# File 'lib/rshade/config/store.rb', line 5 def custom_serializers @custom_serializers end |
#filter_composition ⇒ Object (readonly)
Returns the value of attribute filter_composition.
5 6 7 |
# File 'lib/rshade/config/store.rb', line 5 def filter_composition @filter_composition end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
5 6 7 |
# File 'lib/rshade/config/store.rb', line 5 def formatter @formatter end |
#tp_events ⇒ Object (readonly)
Returns the value of attribute tp_events.
5 6 7 |
# File 'lib/rshade/config/store.rb', line 5 def tp_events @tp_events end |
Instance Method Details
#add_custom_serializers(hash) ⇒ Object
23 24 25 26 |
# File 'lib/rshade/config/store.rb', line 23 def add_custom_serializers(hash) custom_serializers.merge!(hash) self end |
#config_filter(filter_type, &block) ⇒ Object
29 30 31 32 |
# File 'lib/rshade/config/store.rb', line 29 def config_filter(filter_type, &block) filter_composition.config_filter(filter_type, &block) self end |
#set_formatter(formatter) ⇒ Object
34 35 36 37 |
# File 'lib/rshade/config/store.rb', line 34 def set_formatter(formatter) @formatter = formatter self end |
#set_tp_events(tp_events) ⇒ Object
18 19 20 21 |
# File 'lib/rshade/config/store.rb', line 18 def set_tp_events(tp_events) @tp_events = tp_events self end |