Class: Leftovers::Processors::SetPrivacy
- Inherits:
-
Object
- Object
- Leftovers::Processors::SetPrivacy
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/set_privacy.rb
Instance Method Summary collapse
-
#initialize(to) ⇒ SetPrivacy
constructor
A new instance of SetPrivacy.
- #process(str, _current_node, _matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(to) ⇒ SetPrivacy
Returns a new instance of SetPrivacy.
8 9 10 11 12 |
# File 'lib/leftovers/processors/set_privacy.rb', line 8 def initialize(to) @to = to freeze end |
Instance Method Details
#process(str, _current_node, _matched_node, acc) ⇒ Object
14 15 16 17 18 |
# File 'lib/leftovers/processors/set_privacy.rb', line 14 def process(str, _current_node, _matched_node, acc) return unless str acc.set_privacy(str.to_sym, @to) end |