Class: AmberVM::Interpreter::Closures
- Defined in:
- lib/amber/interpreter.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Binding
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Attributes inherited from Element
Instance Method Summary collapse
- #execute(env) ⇒ Object
-
#initialize(content) ⇒ Closures
constructor
A new instance of Closures.
- #optimize(variables = {}) ⇒ Object
Constructor Details
#initialize(content) ⇒ Closures
Returns a new instance of Closures.
338 339 340 |
# File 'lib/amber/interpreter.rb', line 338 def initialize content @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
337 338 339 |
# File 'lib/amber/interpreter.rb', line 337 def content @content end |
Instance Method Details
#execute(env) ⇒ Object
346 347 348 |
# File 'lib/amber/interpreter.rb', line 346 def execute env Binding.new(@content, env.data[:locals].dup) end |
#optimize(variables = {}) ⇒ Object
342 343 344 |
# File 'lib/amber/interpreter.rb', line 342 def optimize variables = {} OptimizedClosures.new(@content, variables) end |