Class Nodes.AssocNode

java.lang.Object
org.ruby_lang.prism.Nodes.Node
org.ruby_lang.prism.Nodes.AssocNode
Enclosing class:
Nodes

public static final class Nodes.AssocNode extends Nodes.Node
 Represents a hash key/value pair.

     { a => b }
       ^^^^^^
 
  • Field Details

    • key

      public final Nodes.Node key
       The key of the association. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
      
           { a: b }
             ^
      
           { foo => bar }
             ^^^
      
           { def a; end => 1 }
             ^^^^^^^^^^
       
    • value

      public final Nodes.Node value
       The value of the association, if present. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
      
           { foo => bar }
                    ^^^
      
           { x: 1 }
                ^
       
  • Constructor Details

    • AssocNode

      public AssocNode(int nodeId, int startOffset, int length, Nodes.Node key, Nodes.Node value)
  • Method Details