Class: Crisp::FunctionRunner
- Inherits:
-
Object
- Object
- Crisp::FunctionRunner
- Defined in:
- lib/crisp/function_runner.rb
Overview
The FunctionRunner can eval function calls by instance_eval the function block
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.run(blk, env, args, name) ⇒ Object
run the blk.
Instance Method Summary collapse
-
#initialize(env, args, name) ⇒ FunctionRunner
constructor
save name, environment and arguments on creation.
Constructor Details
#initialize(env, args, name) ⇒ FunctionRunner
save name, environment and arguments on creation
13 14 15 16 17 |
# File 'lib/crisp/function_runner.rb', line 13 def initialize(env, args, name) @name = name @env = env @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/crisp/function_runner.rb', line 4 def args @args end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/crisp/function_runner.rb', line 4 def env @env end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/crisp/function_runner.rb', line 4 def name @name end |
Class Method Details
.run(blk, env, args, name) ⇒ Object
run the blk
7 8 9 10 |
# File 'lib/crisp/function_runner.rb', line 7 def self.run(blk, env, args, name) runner = new(env, args, name) runner.instance_eval(&blk) end |