Class: Mirah::AST::BlockArgument
- Defined in:
- lib/mirah/ast/method.rb
Instance Attribute Summary collapse
-
#optional ⇒ Object
(also: #optional?)
Returns the value of attribute optional.
Attributes included from Named
Attributes included from Typed
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #infer(typer, expression) ⇒ Object
-
#initialize(parent, line_number, name) ⇒ BlockArgument
constructor
A new instance of BlockArgument.
Methods included from Scoped
Methods included from Named
#string_value, #to_s, #validate_name
Methods inherited from Argument
Methods inherited from Node
#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children
Constructor Details
#initialize(parent, line_number, name) ⇒ BlockArgument
Returns a new instance of BlockArgument.
196 197 198 199 200 |
# File 'lib/mirah/ast/method.rb', line 196 def initialize(parent, line_number, name) super(parent, line_number) self.name = name end |
Instance Attribute Details
#optional ⇒ Object Also known as: optional?
Returns the value of attribute optional.
193 194 195 |
# File 'lib/mirah/ast/method.rb', line 193 def optional @optional end |
Instance Method Details
#infer(typer, expression) ⇒ Object
202 203 204 |
# File 'lib/mirah/ast/method.rb', line 202 def infer(typer, expression) scope.static_scope << name end |