class RBI::TStructConst

Public Class Methods

new(name, type, default: nil, loc: nil, comments: [], &block) click to toggle source
Calls superclass method RBI::TStructField::new
# File lib/rbi/model.rb, line 1065
def initialize(name, type, default: nil, loc: nil, comments: [], &block)
  super(name, type, default: default, loc: loc, comments: comments)
  block&.call(self)
end

Public Instance Methods

compatible_with?(other) click to toggle source
Calls superclass method RBI::TStructField#compatible_with?
# File lib/rbi/rewriters/merge_trees.rb, line 506
def compatible_with?(other)
  other.is_a?(TStructConst) && super
end
fully_qualified_names() click to toggle source
# File lib/rbi/model.rb, line 1071
def fully_qualified_names
  parent_name = parent_scope&.fully_qualified_name
  ["#{parent_name}##{name}"]
end
index_ids() click to toggle source
# File lib/rbi/index.rb, line 162
def index_ids
  fully_qualified_names
end
to_s() click to toggle source
# File lib/rbi/model.rb, line 1077
def to_s
  "#{parent_scope&.fully_qualified_name}.const(:#{name})"
end