Class: Jazzy::SymbolGraph::ExtConstraints
- Inherits:
-
Object
- Object
- Jazzy::SymbolGraph::ExtConstraints
- Defined in:
- lib/jazzy/symbol_graph/ext_node.rb
Overview
For extensions we need to track constraints of the extended type and the constraints introduced by the extension.
Instance Attribute Summary collapse
-
#ext ⇒ Object
array.
-
#type ⇒ Object
array.
Instance Method Summary collapse
-
#initialize(type_constraints, ext_constraints) ⇒ ExtConstraints
constructor
A new instance of ExtConstraints.
-
#merged ⇒ Object
all constraints inherited by members of the extension.
Constructor Details
#initialize(type_constraints, ext_constraints) ⇒ ExtConstraints
Returns a new instance of ExtConstraints.
16 17 18 19 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 16 def initialize(type_constraints, ext_constraints) self.type = type_constraints || [] self.ext = ext_constraints || [] end |
Instance Attribute Details
#ext ⇒ Object
array
9 10 11 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 9 def ext @ext end |
#type ⇒ Object
array
8 9 10 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 8 def type @type end |
Instance Method Details
#merged ⇒ Object
all constraints inherited by members of the extension
12 13 14 |
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 12 def merged (type + ext).sort end |