Class: Verifly::Applicator Abstract
- Inherits:
-
Object
- Object
- Verifly::Applicator
- Extended by:
- ClassBuilder::Mixin
- Defined in:
- lib/verifly/applicator.rb
Overview
implement ‘#call`, `#source` and `#source_location`
Applies “applicable” objects to given bindings (applicable objects are named based on their use, currently any object is applicable).
This class uses ClassBuilder system. When reading the code, we suggest starting from ‘.call’ method
Direct Known Subclasses
InstanceEvaluator, MethodExtractor, ProcApplicatior, Proxy, Quoter
Defined Under Namespace
Classes: InstanceEvaluator, MethodExtractor, ProcApplicatior, Proxy, Quoter
Instance Attribute Summary collapse
-
#applicable ⇒ applicable
wrapped applicable object.
Class Method Summary collapse
-
.call(applicable, binding_, *context) ⇒ Object
Applies applicable on binding_ with context.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
True if applicable matches, false otherwise.
-
#call(binding_, *context) ⇒ Object
abstract
Applies applicable on binding_ with context.
-
#initialize(applicable) ⇒ Applicator
constructor
private
Always use build instead of new.
-
#source_location(binding_) ⇒ [String, Integer]?
abstract
(file, line) location of calblack source (if exists).
Methods included from ClassBuilder::Mixin
build, build_class, buildable_classes=
Constructor Details
#initialize(applicable) ⇒ Applicator
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.
add more examples right here
Always use build instead of new
234 235 236 |
# File 'lib/verifly/applicator.rb', line 234 def initialize(applicable) self.applicable = applicable end |
Instance Attribute Details
#applicable ⇒ applicable
wrapped applicable object
13 14 15 |
# File 'lib/verifly/applicator.rb', line 13 def applicable @applicable end |
Class Method Details
.call(applicable, binding_, *context) ⇒ Object
Applies applicable on binding_ with context
225 226 227 |
# File 'lib/verifly/applicator.rb', line 225 def self.call(applicable, binding_, *context) build(applicable).call(binding_, *context) end |
Instance Method Details
#==(other) ⇒ Boolean
Returns true if applicable matches, false otherwise.
240 241 242 |
# File 'lib/verifly/applicator.rb', line 240 def ==(other) applicable == other.applicable end |
#call(binding_, *context) ⇒ Object
Applies applicable on binding_ with context
|
# File 'lib/verifly/applicator.rb', line 244
|
#source_location(binding_) ⇒ [String, Integer]?
Returns (file, line) location of calblack source (if exists).
|
# File 'lib/verifly/applicator.rb', line 251
|