class SyntaxTree::ARefField
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/syntax_tree/node.rbs class SyntaxTree::ARefField < SyntaxTree::Node def accept: (Visitor visitor) -> untyped end
= value
always wrapped in assign nodes.
ARefField node itself is just the left side of the assignment, and they’re
Put another way, it’s any time you’re calling the method #[]=. The
ARefField represents assigning values into collections at specific indices.
def ===(other)
def ===(other) other.is_a?(ARefField) && collection === other.collection && index === other.index end
def accept(visitor)
Experimental RBS support (using type sampling data from the type_fusion
project).
def accept: (Visitor visitor) -> untyped
This signature was generated using 1 sample from 1 application.
def accept(visitor) visitor.visit_aref_field(self) end
def child_nodes
def child_nodes [collection, index] end
def copy(collection: nil, index: nil, location: nil)
def copy(collection: nil, index: nil, location: nil) node = ARefField.new( collection: collection || self.collection, index: index || self.index, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { collection: collection, index: index, location: location, comments: comments } end
def format(q)
def format(q) q.group do q.format(collection) q.text("[") if index q.indent do q.breakable_empty q.format(index) end q.breakable_empty end q.text("]") end end
def initialize(collection:, index:, location:)
def initialize(collection:, index:, location:) @collection = collection @index = index @location = location @comments = [] end