Class: Rubinius::AST::HashLiteral
- Defined in:
- lib/compiler/ast/literals.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
Returns the value of attribute array.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, array) ⇒ HashLiteral
constructor
A new instance of HashLiteral.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, array) ⇒ HashLiteral
Returns a new instance of HashLiteral.
52 53 54 55 |
# File 'lib/compiler/ast/literals.rb', line 52 def initialize(line, array) @line = line @array = array end |
Instance Attribute Details
#array ⇒ Object
Returns the value of attribute array.
50 51 52 |
# File 'lib/compiler/ast/literals.rb', line 50 def array @array end |
Instance Method Details
#to_sexp ⇒ Object
57 58 59 |
# File 'lib/compiler/ast/literals.rb', line 57 def to_sexp @array.inject([:hash]) { |s, x| s << x.to_sexp } end |