Class: RBI::AttrAccessor
- Inherits:
-
Attr
- Object
- Node
- NodeWithComments
- Attr
- RBI::AttrAccessor
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Instance Attribute Summary
Attributes inherited from Attr
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from Attr
#accept_printer, #index_ids, #initialize, #merge_with, #oneline?
Methods included from Indexable
Methods inherited from NodeWithComments
#initialize, #merge_with, #oneline?
Methods inherited from Node
#accept_printer, #detach, #group_kind, #initialize, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #replace, #string
Constructor Details
This class inherits a constructor from RBI::Attr
Instance Method Details
#compatible_with?(other) ⇒ Boolean
380 381 382 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 380 def compatible_with?(other) other.is_a?(AttrAccessor) && super end |
#fully_qualified_names ⇒ Object
313 314 315 316 |
# File 'lib/rbi/model.rb', line 313 def fully_qualified_names parent_name = parent_scope&.fully_qualified_name names.flat_map { |name| ["#{parent_name}##{name}", "#{parent_name}##{name}="] } end |
#to_s ⇒ Object
319 320 321 322 |
# File 'lib/rbi/model.rb', line 319 def to_s symbols = names.map { |name| ":#{name}" }.join(", ") "#{parent_scope&.fully_qualified_name}.attr_accessor(#{symbols})" end |