Class: RBI::TEnumValue

Inherits:
NodeWithComments show all
Includes:
Indexable
Defined in:
lib/rbi/index.rb,
lib/rbi/model.rb

Instance Attribute Summary collapse

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from NodeWithComments

#annotations, #merge_with, #version_requirements

Methods inherited from Node

#compatible_with?, #detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string

Constructor Details

#initialize(name, loc: nil, comments: [], &block) ⇒ TEnumValue

: (String name, ?loc: Loc?, ?comments: Array) ?{ (TEnumValue node) -> void } -> void



1025
1026
1027
1028
1029
# File 'lib/rbi/model.rb', line 1025

def initialize(name, loc: nil, comments: [], &block)
  super(loc: loc, comments: comments)
  @name = name
  block&.call(self)
end

Instance Attribute Details

#nameObject (readonly)

: String



1022
1023
1024
# File 'lib/rbi/model.rb', line 1022

def name
  @name
end

Instance Method Details

#fully_qualified_nameObject

: -> String



1032
1033
1034
# File 'lib/rbi/model.rb', line 1032

def fully_qualified_name
  "#{parent_scope&.fully_qualified_name}::#{name}"
end

#index_idsObject

: -> Array



224
225
226
# File 'lib/rbi/index.rb', line 224

def index_ids
  [fully_qualified_name]
end

#to_sObject

: -> String



1038
1039
1040
# File 'lib/rbi/model.rb', line 1038

def to_s
  fully_qualified_name
end