Class: CodeTools::AST::Alias
- Defined in:
- lib/rubinius/code/ast/definitions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, to, from) ⇒ Alias
constructor
A new instance of Alias.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, to, from) ⇒ Alias
Returns a new instance of Alias.
8 9 10 11 12 |
# File 'lib/rubinius/code/ast/definitions.rb', line 8 def initialize(line, to, from) @line = line @to = to @from = from end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/rubinius/code/ast/definitions.rb', line 6 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
6 7 8 |
# File 'lib/rubinius/code/ast/definitions.rb', line 6 def to @to end |
Instance Method Details
#bytecode(g) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/rubinius/code/ast/definitions.rb', line 14 def bytecode(g) pos(g) g.push_scope @to.bytecode(g) @from.bytecode(g) g.send :alias_method, 2, true end |
#to_sexp ⇒ Object
23 24 25 |
# File 'lib/rubinius/code/ast/definitions.rb', line 23 def to_sexp [:alias, @to.to_sexp, @from.to_sexp] end |