Class: RBI::TypeMember
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::TypeMember
- Extended by:
- T::Sig
- Includes:
- Indexable
- Defined in:
- lib/rbi/index.rb,
lib/rbi/model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #fully_qualified_name ⇒ Object
- #index_ids ⇒ Object
-
#initialize(name, value, loc: nil, comments: [], &block) ⇒ TypeMember
constructor
A new instance of TypeMember.
- #to_s ⇒ Object
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, value, loc: nil, comments: [], &block) ⇒ TypeMember
Returns a new instance of TypeMember.
1418 1419 1420 1421 1422 1423 |
# File 'lib/rbi/model.rb', line 1418 def initialize(name, value, loc: nil, comments: [], &block) super(loc: loc, comments: comments) @name = name @value = value block&.call(self) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
1407 1408 1409 |
# File 'lib/rbi/model.rb', line 1407 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
1407 1408 1409 |
# File 'lib/rbi/model.rb', line 1407 def value @value end |
Instance Method Details
#fully_qualified_name ⇒ Object
1426 1427 1428 1429 1430 |
# File 'lib/rbi/model.rb', line 1426 def fully_qualified_name return name if name.start_with?("::") "#{parent_scope&.fully_qualified_name}::#{name}" end |
#index_ids ⇒ Object
183 184 185 |
# File 'lib/rbi/index.rb', line 183 def index_ids [to_s] end |
#to_s ⇒ Object
1433 1434 1435 |
# File 'lib/rbi/model.rb', line 1433 def to_s fully_qualified_name end |