Class: Jazzy::SymbolGraph::ExtSymNode
- Defined in:
- lib/jazzy/symbol_graph/ext_node.rb,
lib/jazzy/symbol_graph/ext_key.rb
Overview
An ExtSymNode is an extension generated from a Swift 5.9 extension symbol, for extensions of types from other modules only.
Instance Attribute Summary collapse
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Attributes inherited from ExtNode
#all_constraints, #conformances, #name, #real_usr, #usr
Attributes inherited from BaseNode
Instance Method Summary collapse
- #ext_key ⇒ Object
-
#initialize(symbol) ⇒ ExtSymNode
constructor
A new instance of ExtSymNode.
- #to_sourcekit(module_name, ext_module_name) ⇒ Object
Methods inherited from ExtNode
#<=>, #add_conformance, #constraints, #full_declaration, new_for_conformance, new_for_member, #sort_key
Methods inherited from BaseNode
#add_child, #add_children_to_sourcekit
Constructor Details
#initialize(symbol) ⇒ ExtSymNode
Returns a new instance of ExtSymNode.
124 125 126 127 128 129 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 124 def initialize(symbol) self.symbol = symbol super(symbol.usr, symbol.full_name, # sadly can't tell what constraints are inherited vs added ExtConstraints.new([], symbol.constraints)) end |
Instance Attribute Details
#symbol ⇒ Object
Returns the value of attribute symbol.
122 123 124 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 122 def symbol @symbol end |
Instance Method Details
#ext_key ⇒ Object
32 33 34 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 32 def ext_key ExtKey.new(usr, all_constraints.ext) end |
#to_sourcekit(module_name, ext_module_name) ⇒ Object
131 132 133 134 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 131 def to_sourcekit(module_name, ext_module_name) hash = super symbol.add_to_sourcekit(hash) end |