class RBI::Const
Consts
Attributes
name[R]
value[R]
Public Class Methods
new(name, value, loc: nil, comments: [], &block)
click to toggle source
Calls superclass method
RBI::NodeWithComments::new
# File lib/rbi/model.rb, line 307 def initialize(name, value, loc: nil, comments: [], &block) super(loc: loc, comments: comments) @name = name @value = value block&.call(self) end
Public Instance Methods
accept_printer(v)
click to toggle source
# File lib/rbi/printer.rb, line 289 def accept_printer(v) previous_node = v.previous_node v.printn if previous_node && (!previous_node.oneline? || !oneline?) v.printl("# #{loc}") if loc && v.print_locs v.visit_all(comments) v.printl("#{name} = #{value}") end
compatible_with?(other)
click to toggle source
# File lib/rbi/rewriters/merge_trees.rb, line 375 def compatible_with?(other) other.is_a?(Const) && name == other.name && value == other.value end
fully_qualified_name()
click to toggle source
# File lib/rbi/model.rb, line 315 def fully_qualified_name return name if name.start_with?("::") "#{parent_scope&.fully_qualified_name}::#{name}" end
index_ids()
click to toggle source
# File lib/rbi/index.rb, line 92 def index_ids [fully_qualified_name] end
to_s()
click to toggle source
# File lib/rbi/model.rb, line 321 def to_s fully_qualified_name end