Class: Verifly::Applicator::InstanceEvaluator
- Inherits:
-
Verifly::Applicator
- Object
- Verifly::Applicator
- Verifly::Applicator::InstanceEvaluator
- Defined in:
- lib/verifly/applicator.rb
Overview
InstanceEvaluator is used for strings. It works like instance_eval or Binding#eval depending on binding_ class
Instance Attribute Summary
Attributes inherited from Verifly::Applicator
Class Method Summary collapse
Instance Method Summary collapse
-
#call(binding_, *context) ⇒ Object
Application result.
-
#source ⇒ String
Exactly it’s defenition.
-
#source_location ⇒ nil
Source location is not available.
Methods inherited from Verifly::Applicator
Methods included from ClassBuilder::Mixin
#build, #build_class, #buildable_classes=
Constructor Details
This class inherits a constructor from Verifly::Applicator
Class Method Details
.build_class(applicable) ⇒ Object
118 119 120 |
# File 'lib/verifly/applicator.rb', line 118 def self.build_class(applicable) self if applicable.is_a?(String) end |
Instance Method Details
#call(binding_, *context) ⇒ Object
Returns application result.
125 126 127 128 129 130 131 132 133 |
# File 'lib/verifly/applicator.rb', line 125 def call(binding_, *context) if binding_.is_a?(Binding) binding_ = binding_.dup binding_.local_variable_set(:context, context) binding_.eval(applicable, *caller_line) else binding_.instance_eval(applicable, *caller_line) end end |
#source ⇒ String
Returns exactly it’s defenition.
140 141 142 |
# File 'lib/verifly/applicator.rb', line 140 def source(*) applicable end |
#source_location ⇒ nil
Source location is not available
137 |
# File 'lib/verifly/applicator.rb', line 137 def source_location(*); end |