Class: RBI::Module
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
: String.
Attributes inherited from Tree
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool.
-
#fully_qualified_name ⇒ Object
: -> String.
-
#initialize(name, loc: nil, comments: [], &block) ⇒ Module
constructor
: (String name, ?loc: Loc?, ?comments: Array) ?{ (Module node) -> void } -> void.
Methods inherited from Scope
Methods included from Indexable
Methods inherited from Tree
#<<, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #filter_versions!, #flatten_singleton_methods!, #flatten_visibilities!, #group_nodes!, #index, #merge, #nest_non_public_members!, #nest_singleton_methods!, #nest_top_level_members!, #replace_attributes_with_methods!, #sort_nodes!, #translate_rbs_sigs!
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#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) ⇒ Module
: (String name, ?loc: Loc?, ?comments: Array) ?{ (Module node) -> void } -> void
187 188 189 190 191 |
# File 'lib/rbi/model.rb', line 187 def initialize(name, loc: nil, comments: [], &block) super(loc: loc, comments: comments) {} @name = name block&.call(self) end |
Instance Attribute Details
#name ⇒ Object
: String
184 185 186 |
# File 'lib/rbi/model.rb', line 184 def name @name end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
370 371 372 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 370 def compatible_with?(other) other.is_a?(Module) end |
#fully_qualified_name ⇒ Object
: -> String
195 196 197 198 199 |
# File 'lib/rbi/model.rb', line 195 def fully_qualified_name return name if name.start_with?("::") "#{parent_scope&.fully_qualified_name}::#{name}" end |