class SyntaxTree::MethodAddBlock
Experimental RBS support (using type sampling data from the type_fusion project).
# sig/syntax_tree/node.rbs class SyntaxTree::MethodAddBlock < SyntaxTree::Node def accept: (Visitor visitor) -> untyped def child_nodes: () -> untyped def initialize: (call: SyntaxTree::CallNode, block: SyntaxTree::BlockNode, location: SyntaxTree::Location) -> void end
method {}
MethodAddBlock represents a method call with a block argument.
def ===(other)
def ===(other) other.is_a?(MethodAddBlock) && call === other.call && block === other.block end
def accept(visitor)
Experimental RBS support (using type sampling data from the type_fusion project).
def accept: (Visitor visitor) -> untyped
This signature was generated using 3 samples from 1 application.
def accept(visitor) visitor.visit_method_add_block(self) end
def child_nodes
Experimental RBS support (using type sampling data from the type_fusion project).
def child_nodes: () -> untyped
This signature was generated using 2 samples from 1 application.
def child_nodes [call, block] end
def copy(call: nil, block: nil, location: nil)
def copy(call: nil, block: nil, location: nil) node = MethodAddBlock.new( call: call || self.call, block: block || self.block, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { call: call, block: block, location: location, comments: comments } end
def format(q)
def format(q) # If we're at the top of a call chain, then we're going to do some # specialized printing in case we can print it nicely. We _only_ do this # at the top of the chain to avoid weird recursion issues. if CallChainFormatter.chained?(call) && !CallChainFormatter.chained?(q.parent) q.group do q .if_break { CallChainFormatter.new(self).format(q) } .if_flat { format_contents(q) } end else format_contents(q) end end
def format_contents(q)
def format_contents(q) q.format(call) q.format(block) end
def initialize(call:, block:, location:)
Experimental RBS support (using type sampling data from the type_fusion project).
def initialize: (call: SyntaxTree::CallNode, block: SyntaxTree::BlockNode, location: SyntaxTree::Location) -> void
This signature was generated using 4 samples from 1 application.
def initialize(call:, block:, location:) @call = call @block = block @location = location @comments = [] end