Class: SmartCore::Initializer::Attribute::Finalizer::AnonymousBlock Private
- Inherits:
-
Abstract
- Object
- Abstract
- SmartCore::Initializer::Attribute::Finalizer::AnonymousBlock
- Defined in:
- lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #call(value, instance) ⇒ value private
-
#default_identity? ⇒ Boolean
private
True only when wrapping the shared identity default, which returns its argument untouched (so a value validated before the call is still valid after it).
- #initialize(finalizer) ⇒ void constructor private
Methods inherited from Abstract
Constructor Details
#initialize(finalizer) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb', line 12 def initialize(finalizer) @finalizer = finalizer end |
Instance Method Details
#call(value, instance) ⇒ value
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb', line 22 def call(value, instance) instance.instance_exec(value, &finalizer) end |
#default_identity? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true only when wrapping the shared identity default, which returns its argument untouched (so a value validated before the call is still valid after it).
32 33 34 |
# File 'lib/smart_core/initializer/attribute/finalizer/anonymous_block.rb', line 32 def default_identity? finalizer.equal?(SmartCore::Initializer::Attribute::Value::Base::DEFAULT_FINALIZER) end |