class SyntaxTree::AssocSplat
AssocSplat
represents double-splatting a value into a hash (either a hash literal or a bare hash in a method call).
{ **pairs }
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 1582 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 1618 def ===(other) other.is_a?(AssocSplat) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 1588 def accept(visitor) visitor.visit_assoc_splat(self) end
Source
# File lib/syntax_tree/node.rb, line 1592 def child_nodes [value] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 1596 def copy(value: nil, location: nil) node = AssocSplat.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 1609 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 1613 def format(q) q.text("**") q.format(value) if value end