Class: Logasm::Preprocessors::Strategies::Mask
- Inherits:
-
Object
- Object
- Logasm::Preprocessors::Strategies::Mask
- Defined in:
- lib/logasm/preprocessors/strategies/mask.rb
Constant Summary collapse
- MASK_SYMBOL =
'*'.freeze
- MASKED_VALUE =
MASK_SYMBOL * 5
Instance Method Summary collapse
-
#initialize(trie) ⇒ Mask
constructor
A new instance of Mask.
- #process(data, pointer = '') ⇒ Object
Constructor Details
#initialize(trie) ⇒ Mask
Returns a new instance of Mask.
8 9 10 |
# File 'lib/logasm/preprocessors/strategies/mask.rb', line 8 def initialize(trie) @trie = trie end |
Instance Method Details
#process(data, pointer = '') ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/logasm/preprocessors/strategies/mask.rb', line 12 def process(data, pointer = '') return MASKED_VALUE unless @trie.include?(pointer) case data when Hash process_hash(data, pointer) when Array process_array(data, pointer) else data end end |