Skip to content
On this page
class · Ruby 4.0

Prism::AssocNode

< Prism::Node 13 instance methods 2 class methods

Represents a hash key/value pair.

{ a => b }
  ^^^^^^

Class methods 2

Instance methods 13

Attributes

key

Read

The key of the association. This can be any non-void expression.

{ a: b }
  ^

{ foo => bar }
  ^^^

{ def a; end => 1 }
  ^^^^^^^^^^
Read

The value of the association, if present. This can be any non-void expression.

{ foo => bar }
         ^^^

{ x: 1 }
     ^