Skip to content
On this page

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class · Ruby 3.4

Prism::InstanceVariableWriteNode

< Prism::Node 15 instance methods 2 class methods

Represents writing to an instance variable.

@foo = 1
^^^^^^^^

Class methods 2

Instance methods 15

Attributes
Read

The name of the instance variable, which is a ‘@` followed by an [identifier](github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).

Example
@x = :y       # name `:@x`

@_foo = "bar" # name `@_foo`
Read

The value to write to the instance variable. It can be any [non-void expression](github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).

@foo = :bar
       ^^^^

@_x = 1234
      ^^^^