Class: RShade::Config::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/rshade/config/store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Store

Returns a new instance of Store.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):



11
12
13
14
15
16
# File 'lib/rshade/config/store.rb', line 11

def initialize(options={})
  @filter_composition = options.fetch(:filter_composition, default_filter_composition)
  @formatter = options.fetch(:formatter, ::RShade::Formatter::Stdout)
  @tp_events = options.fetch(:tp_events, [:call, :return])
  @custom_serializers = options.fetch(:custom_serializers, {})
end

Instance Attribute Details

#custom_serializersObject (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_compositionObject (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

#formatterObject (readonly)

Returns the value of attribute formatter.



5
6
7
# File 'lib/rshade/config/store.rb', line 5

def formatter
  @formatter
end

#tp_eventsObject (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