Class: RBI::SingletonClass
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/printer.rb
Instance Attribute Summary
Attributes inherited from Tree
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #fully_qualified_name ⇒ Object
-
#initialize(loc: nil, comments: [], &block) ⇒ SingletonClass
constructor
A new instance of SingletonClass.
- #print_header(v) ⇒ Object
Methods inherited from Scope
#accept_printer, #dup_empty, #index_ids, #print_body, #to_s
Methods included from Indexable
Methods inherited from Tree
#<<, #accept_printer, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #group_nodes!, #index, #merge, #nest_non_public_methods!, #nest_singleton_methods!, #oneline?, #sort_nodes!
Methods inherited from NodeWithComments
#annotations, #merge_with, #oneline?
Methods inherited from Node
#accept_printer, #compatible_with?, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #print_blank_line_before, #replace, #string
Constructor Details
#initialize(loc: nil, comments: [], &block) ⇒ SingletonClass
Returns a new instance of SingletonClass.
255 256 257 258 |
# File 'lib/rbi/model.rb', line 255 def initialize(loc: nil, comments: [], &block) super(loc: loc, comments: comments) {} block&.call(self) end |
Instance Method Details
#fully_qualified_name ⇒ Object
261 262 263 |
# File 'lib/rbi/model.rb', line 261 def fully_qualified_name "#{parent_scope&.fully_qualified_name}::<self>" end |
#print_header(v) ⇒ Object
291 292 293 294 295 296 297 298 |
# File 'lib/rbi/printer.rb', line 291 def print_header(v) v.printt("class << self") if empty? v.printn("; end") else v.printn end end |