Class: Duby::AST::ClosureDefinition
- Inherits:
-
ClassDefinition
- Object
- Node
- ClassDefinition
- Duby::AST::ClosureDefinition
- Defined in:
- lib/duby/compiler.rb,
lib/duby/ast/class.rb
Instance Attribute Summary collapse
-
#enclosing_type ⇒ Object
Returns the value of attribute enclosing_type.
Attributes inherited from ClassDefinition
Attributes included from Scope
Attributes included from Named
Attributes included from Annotated
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #compile(compiler, expression) ⇒ Object
-
#initialize(parent, position, name, enclosing_type) ⇒ ClosureDefinition
constructor
A new instance of ClosureDefinition.
Methods inherited from ClassDefinition
#_define_method, #append_node, #declare_field, #define_constructor, #define_inner_class, #define_method, #define_static_method, #implements, #infer
Methods included from Named
Methods included from Annotated
Methods inherited from Node
#<<, ===, #[], #_set_parent, child, child_name, #each, #empty?, #expr?, #initialize_copy, #insert, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s
Constructor Details
#initialize(parent, position, name, enclosing_type) ⇒ ClosureDefinition
Returns a new instance of ClosureDefinition.
134 135 136 137 138 139 |
# File 'lib/duby/ast/class.rb', line 134 def initialize(parent, position, name, enclosing_type) super(parent, position, name, []) do [nil, nil] end @enclosing_type = enclosing_type end |
Instance Attribute Details
#enclosing_type ⇒ Object
Returns the value of attribute enclosing_type.
133 134 135 |
# File 'lib/duby/ast/class.rb', line 133 def enclosing_type @enclosing_type end |
Instance Method Details
#compile(compiler, expression) ⇒ Object
225 226 227 |
# File 'lib/duby/compiler.rb', line 225 def compile(compiler, expression) compiler.define_closure(self, expression) end |