Class: RShade::Config::StackStore
- Defined in:
- lib/rshade/config/stack_store.rb
Constant Summary collapse
- DEFAULT_FORMATTER =
{ json: ::RShade::Formatter::Stack::Json, stdout: ::RShade::Formatter::Stack::Stdout }.freeze
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#variable_serializer ⇒ Object
readonly
Returns the value of attribute variable_serializer.
Instance Method Summary collapse
- #exclude_gems! ⇒ Object
- #filter!(filter_type, &block) ⇒ Object
- #formatter!(formatter, opts = {}) ⇒ Object
-
#initialize(formatter: RShade::Formatter::Stack::Stdout.new, filter: default_filter_composition, serializers: {}) ⇒ StackStore
constructor
A new instance of StackStore.
- #serializer!(hash) ⇒ Object
Constructor Details
#initialize(formatter: RShade::Formatter::Stack::Stdout.new, filter: default_filter_composition, serializers: {}) ⇒ StackStore
Returns a new instance of StackStore.
16 17 18 19 20 21 |
# File 'lib/rshade/config/stack_store.rb', line 16 def initialize(formatter: RShade::Formatter::Stack::Stdout.new, filter: default_filter_composition, serializers: {}) @filter = filter @formatter = formatter @variable_serializer = ::RShade::Serializer::Traversal.new(serializers) end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
6 7 8 |
# File 'lib/rshade/config/stack_store.rb', line 6 def filter @filter end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
6 7 8 |
# File 'lib/rshade/config/stack_store.rb', line 6 def formatter @formatter end |
#variable_serializer ⇒ Object (readonly)
Returns the value of attribute variable_serializer.
6 7 8 |
# File 'lib/rshade/config/stack_store.rb', line 6 def variable_serializer @variable_serializer end |
Instance Method Details
#exclude_gems! ⇒ Object
38 39 40 41 42 43 |
# File 'lib/rshade/config/stack_store.rb', line 38 def exclude_gems! filter!(::RShade::Filter::ExcludePathFilter) do |paths| paths.concat(RShade::Utils.default_excluded_path) end self end |
#filter!(filter_type, &block) ⇒ Object
28 29 30 31 |
# File 'lib/rshade/config/stack_store.rb', line 28 def filter!(filter_type, &block) filter.filter(filter_type, &block) self end |
#formatter!(formatter, opts = {}) ⇒ Object
33 34 35 36 |
# File 'lib/rshade/config/stack_store.rb', line 33 def formatter!(formatter, opts = {}) @formatter = formatter.is_a?(Symbol) ? set_symbol_formatter(formatter, opts) : formatter self end |
#serializer!(hash) ⇒ Object
23 24 25 26 |
# File 'lib/rshade/config/stack_store.rb', line 23 def serializer!(hash) variable_serializer.merge!(hash) self end |