class SyntaxTree::BlockVar
Experimental RBS support (using type sampling data from the type_fusion project).
# sig/syntax_tree/node.rbs class SyntaxTree::BlockVar < SyntaxTree::Node def accept: (Visitor visitor) -> untyped def child_nodes: () -> untyped end
end
method do |positional, optional = value, keyword:, █ local|
various parameter types, as well as block-local variable declarations.
this node is everything contained within the pipes. This includes all of the
BlockVar represents the parameters being declared for a block. Effectively
def ===(other)
def ===(other) other.is_a?(BlockVar) && params === other.params && ArrayMatch.call(locals, other.locals) 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_block_var(self) end
def arg0?
When a single required parameter is declared for a block, it gets
def arg0? params.requireds.length == 1 && params.optionals.empty? && params.rest.nil? && params.posts.empty? && params.keywords.empty? && params.keyword_rest.nil? && params.block.nil? 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 [params, *locals] end
def copy(params: nil, locals: nil, location: nil)
def copy(params: nil, locals: nil, location: nil) node = BlockVar.new( params: params || self.params, locals: locals || self.locals, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { params: params, locals: locals, location: location, comments: comments } end
def format(q)
def format(q) q.text("|") q.group do q.remove_breaks(q.format(params)) if locals.any? q.text("; ") q.seplist(locals, SEPARATOR) { |local| q.format(local) } end end q.text("|") end
def initialize(params:, locals:, location:)
def initialize(params:, locals:, location:) @params = params @locals = locals @location = location @comments = [] end