class SyntaxTree::Const
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/syntax_tree/node.rbs class SyntaxTree::Const < SyntaxTree::Node def accept: (Visitor visitor) -> untyped def child_nodes: () -> untyped def initialize: (value: String, location: SyntaxTree::Location) -> void end
:Constant
or a symbol that starts with a capital letter:
object.Constant
in a method call to a capitalized method:
It could also be something that looks like a constant in another context, as
Constant
actually be a reference to a constant:
Const represents a literal value that looks like a constant. This could
def ===(other)
def ===(other) other.is_a?(Const) && value === other.value 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 19 samples from 1 application.
def accept(visitor) visitor.visit_const(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 21 samples from 1 application.
def child_nodes [] end
def copy(value: nil, location: nil)
def copy(value: nil, location: nil) node = Const.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
def format(q)
def format(q) q.text(value) end
def initialize(value:, location:)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (value: String, location: SyntaxTree::Location) -> void
This signature was generated using 23 samples from 1 application.
def initialize(value:, location:) @value = value @location = location @comments = [] end