class method
Prism::Node.fields
fields
lib/prism/node.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/node.rb, line 245
def self.fields
# This method should only be called on subclasses of Node, not Node
# itself.
raise NoMethodError, "undefined method `fields' for #{inspect}" if self == Node
Reflection.fields_for(self)
end
Returns a list of the fields that exist for this node class. Fields describe the structure of the node. This kind of reflection is useful for things like recursively visiting each node and field in the tree.