Class: Cased::Sensitive::Handler
- Inherits:
-
Object
- Object
- Cased::Sensitive::Handler
- Defined in:
- lib/cased/sensitive/handler.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Class Method Summary collapse
Instance Method Summary collapse
- #call(audit_event, key, value) ⇒ Object
-
#initialize(label, handler) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(label, handler) ⇒ Handler
Returns a new instance of Handler.
20 21 22 23 |
# File 'lib/cased/sensitive/handler.rb', line 20 def initialize(label, handler) @label = label.to_sym @handler = prepare_handler(handler) end |
Class Attribute Details
.handlers ⇒ Object
6 7 8 |
# File 'lib/cased/sensitive/handler.rb', line 6 def self.handlers @handlers ||= [] end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
18 19 20 |
# File 'lib/cased/sensitive/handler.rb', line 18 def label @label end |
Class Method Details
Instance Method Details
#call(audit_event, key, value) ⇒ Object
25 26 27 |
# File 'lib/cased/sensitive/handler.rb', line 25 def call(audit_event, key, value) @handler.call(audit_event, key.to_sym, value) end |