Class: Verifly::Applicator::ProcApplicatior
- Inherits:
-
Verifly::Applicator
- Object
- Verifly::Applicator
- Verifly::Applicator::ProcApplicatior
- Defined in:
- lib/verifly/applicator.rb
Overview
ProcApplicatior is used when #to_proc is available. It works not only with procs, but also with hashes etc
Instance Attribute Summary
Attributes inherited from Verifly::Applicator
Class Method Summary collapse
Instance Method Summary collapse
-
#call(binding_, *context) ⇒ Object
Application result.
-
#source ⇒ String
Proc#source.
-
#source_location ⇒ String, Integer
Proc#source_location.
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
167 168 169 |
# File 'lib/verifly/applicator.rb', line 167 def self.build_class(applicable) self if applicable.respond_to?(:to_proc) end |
Instance Method Details
#call(binding_, *context) ⇒ Object
Returns application result.
174 175 176 |
# File 'lib/verifly/applicator.rb', line 174 def call(binding_, *context) invoke_lambda(applicable.to_proc, binding_, *context) end |
#source ⇒ String
Returns Proc#source.
184 185 186 |
# File 'lib/verifly/applicator.rb', line 184 def source(*) applicable.to_proc.source end |
#source_location ⇒ String, Integer
Returns Proc#source_location.
179 180 181 |
# File 'lib/verifly/applicator.rb', line 179 def source_location(*) applicable.to_proc.source_location end |