Class: Lenjador::Preprocessors::Strategies::Mask
- Inherits:
-
Object
- Object
- Lenjador::Preprocessors::Strategies::Mask
- Defined in:
- lib/lenjador/preprocessors/strategies/mask.rb
Constant Summary collapse
- MASK_SYMBOL =
'*'- 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.
10 11 12 |
# File 'lib/lenjador/preprocessors/strategies/mask.rb', line 10 def initialize(trie) @trie = trie end |
Instance Method Details
#process(data, pointer = '') ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/lenjador/preprocessors/strategies/mask.rb', line 14 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) when String, Numeric, Symbol, Date, Time, TrueClass, FalseClass, NilClass data else MASKED_VALUE end end |