Class: Jazzy::SymbolGraph::ExtKey
- Inherits:
-
Object
- Object
- Jazzy::SymbolGraph::ExtKey
- Defined in:
- lib/jazzy/symbol_graph/ext_key.rb
Overview
An ExtKey identifies an extension of a type, made up of the USR of the type and the constraints of the extension. With Swift 5.9 extension symbols, the USR is the ‘fake’ USR invented by symbolgraph to solve the same problem as this type, which means less merging takes place.
Instance Attribute Summary collapse
-
#constraints_text ⇒ Object
Returns the value of attribute constraints_text.
-
#usr ⇒ Object
Returns the value of attribute usr.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
- #hash_key ⇒ Object
-
#initialize(usr, constraints) ⇒ ExtKey
constructor
A new instance of ExtKey.
Constructor Details
#initialize(usr, constraints) ⇒ ExtKey
Returns a new instance of ExtKey.
13 14 15 16 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 13 def initialize(usr, constraints) self.usr = usr self.constraints_text = constraints.map(&:to_swift).join end |
Instance Attribute Details
#constraints_text ⇒ Object
Returns the value of attribute constraints_text.
11 12 13 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 11 def constraints_text @constraints_text end |
#usr ⇒ Object
Returns the value of attribute usr.
10 11 12 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 10 def usr @usr end |
Instance Method Details
#eql?(other) ⇒ Boolean
22 23 24 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 22 def eql?(other) hash_key == other.hash_key end |
#hash ⇒ Object
26 27 28 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 26 def hash hash_key.hash end |
#hash_key ⇒ Object
18 19 20 |
# File 'lib/jazzy/symbol_graph/ext_key.rb', line 18 def hash_key usr + constraints_text end |