class YARP::KeywordHashNode
Represents a hash literal without opening and closing braces.
foo(a: b) ^^^^
Attributes
elements[R]
attr_reader elements: Array
Public Class Methods
Public Instance Methods
accept(visitor)
click to toggle source
def accept: (visitor: Visitor
) -> void
# File yarp/node.rb, line 6394 def accept(visitor) visitor.visit_keyword_hash_node(self) end
child_nodes()
click to toggle source
def child_nodes
: () -> Array[nil | Node]
# File yarp/node.rb, line 6399 def child_nodes [*elements] end
Also aliased as: deconstruct
comment_targets()
click to toggle source
def comment_targets
: () -> Array[Node | Location]
# File yarp/node.rb, line 6404 def comment_targets [*elements] end
copy(**params)
click to toggle source
def copy: (**params) -> KeywordHashNode
# File yarp/node.rb, line 6409 def copy(**params) KeywordHashNode.new( params.fetch(:elements) { elements }, params.fetch(:location) { location }, ) end
deconstruct_keys(keys)
click to toggle source
inspect(inspector = NodeInspector.new)
click to toggle source
# File yarp/node.rb, line 6424 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector << "└── elements: #{inspector.list("#{inspector.prefix} ", elements)}" inspector.to_str end