class SyntaxTree::ArgBlock
ArgBlock
represents using a block operator on an expression.
method(&expression)
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 894 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 930 def ===(other) other.is_a?(ArgBlock) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 900 def accept(visitor) visitor.visit_arg_block(self) end
Source
# File lib/syntax_tree/node.rb, line 904 def child_nodes [value] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 908 def copy(value: nil, location: nil) node = ArgBlock.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 921 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 925 def format(q) q.text("&") q.format(value) if value end