class YARP::MatchWriteNode
Represents writing local variables using a regular expression match with named capture groups.
/(?<foo>bar)/ =~ baz ^^^^^^^^^^^^^^^^^^^^
Attributes
call[R]
attr_reader call: CallNode
locals[R]
attr_reader locals: Array
Public Class Methods
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File lib/yarp/node.rb, line 8042 def accept(visitor) visitor.visit_match_write_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File lib/yarp/node.rb, line 8047 def child_nodes [call] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File lib/yarp/node.rb, line 8057 def comment_targets [call] end
compact_child_nodes()
click to toggle source
def compact_child_nodes
: () -> Array
# File lib/yarp/node.rb, line 8052 def compact_child_nodes [call] end
copy(**params)
click to toggle source
def copy: (**params) -> MatchWriteNode
# File lib/yarp/node.rb, line 8062 def copy(**params) MatchWriteNode.new( params.fetch(:call) { call }, params.fetch(:locals) { locals }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
inspect(inspector = NodeInspector.new)
click to toggle source
# File lib/yarp/node.rb, line 8078 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "├── call:\n" inspector << inspector.child_node(call, "│ ") inspector << "└── locals: #{locals.inspect}\n" inspector.to_str end