Skip to content

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

class method

Prism::HashPatternNode.type

type

Similar to type, this method returns a symbol that you can use for splitting on the type of the node without having to do a long === chain. Note that like type, it will still be slower than using == for a single class, but should be faster in a case statement or an array comparison.

def self.type: () -> Symbol

See also #type .new #accept #child_nodes also in 4.0 · 3.4