class SyntaxTree::StringEmbExpr
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/syntax_tree/node.rbs class SyntaxTree::StringEmbExpr < SyntaxTree::Node def accept: (Visitor visitor) -> untyped def child_nodes: () -> untyped def initialize: (statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void end
“string #{expression}”
and dynamic symbols.
couple of different parent nodes, including regular expressions, strings,
StringEmbExpr represents interpolated content. It can be contained within a
def ===(other)
def ===(other) other.is_a?(StringEmbExpr) && statements === other.statements 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_string_embexpr(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 1 sample from 1 application.
def child_nodes [statements] end
def copy(statements: nil, location: nil)
def copy(statements: nil, location: nil) node = StringEmbExpr.new( statements: statements || self.statements, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { statements: statements, location: location, comments: comments } end
def format(q)
def format(q) if location.start_line == location.end_line # If the contents of this embedded expression were originally on the # same line in the source, then we're going to leave them in place and # assume that's the way the developer wanted this expression # represented. q.remove_breaks( q.group do q.text('#{') q.format(statements) q.text("}") end ) else q.group do q.text('#{') q.indent do q.breakable_empty q.format(statements) end q.breakable_empty q.text("}") end end end
def initialize(statements:, location:)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void
This signature was generated using 2 samples from 1 application.
def initialize(statements:, location:) @statements = statements @location = location @comments = [] end