Module: Familia::Features::TransientFields::ClassMethods
- Defined in:
- lib/familia/features/transient_fields.rb
Overview
ClassMethods
Instance Method Summary collapse
-
#transient_field(name, as: name, **kwargs) ⇒ Object
Define a transient field that automatically wraps values in RedactedString.
Instance Method Details
#transient_field(name, as: name, **kwargs) ⇒ Object
Define a transient field that automatically wraps values in RedactedString
34 35 36 37 38 39 40 41 |
# File 'lib/familia/features/transient_fields.rb', line 34 def transient_field(name, as: name, **kwargs) # Use the field type system - much cleaner than alias_method approach! # We can now remove the transient_field method from this feature entirely # since it's built into DefinitionMethods using TransientFieldType require_relative 'transient_fields/transient_field_type' field_type = TransientFieldType.new(name, as: as, **kwargs.merge(fast_method: false)) register_field_type(field_type) end |