class Prism::InstanceVariableTargetNode

Represents writing to an instance variable in a context that doesn’t have an explicit value.

@foo, @bar = baz
^^^^  ^^^^

Public Class Methods

new(source, node_id, location, flags, name) click to toggle source

Initialize a new InstanceVariableTargetNode node.

# File lib/prism/node.rb, line 17427
def initialize(source, node_id, location, flags, name)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
  @name = name
end

Public Instance Methods

name → Symbol click to toggle source

Returns the name attribute.

# File lib/prism/node.rb, line 17527
def name
  @name
end

Node Interface

↑ top

Public Class Methods

type() click to toggle source

See Node.type.

# File lib/prism/node.rb, line 17510
def self.type
  :instance_variable_target_node
end

Public Instance Methods

accept(visitor) click to toggle source

See Node.accept.

# File lib/prism/node.rb, line 17449
def accept(visitor)
  visitor.visit_instance_variable_target_node(self)
end
child_nodes() click to toggle source

See Node.child_nodes.

# File lib/prism/node.rb, line 17456
def child_nodes
  []
end
Also aliased as: deconstruct
comment_targets() click to toggle source

See Node.comment_targets.

# File lib/prism/node.rb, line 17479
def comment_targets
  [] #: Array[Prism::node | Location]
end
compact_child_nodes() click to toggle source

See Node.compact_child_nodes.

# File lib/prism/node.rb, line 17472
def compact_child_nodes
  []
end
copy(**fields) → InstanceVariableTargetNode click to toggle source

Creates a copy of self with the given fields, using self as the template.

# File lib/prism/node.rb, line 17489
def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name)
  InstanceVariableTargetNode.new(source, node_id, location, flags, name)
end
deconstruct()
Alias for: child_nodes
each_child_node(&blk) click to toggle source

See Node.each_child_node.

# File lib/prism/node.rb, line 17464
def each_child_node(&blk)
  return to_enum(:each_child_node) unless block_given?

end
type() click to toggle source

See Node#type.

# File lib/prism/node.rb, line 17503
def type
  :instance_variable_target_node
end

Repository

↑ top

Slicing

↑ top