Class: Jazzy::SymbolGraph::ExtConstraints

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(type_constraints, ext_constraints) ⇒ ExtConstraints

Returns a new instance of ExtConstraints.



18
19
20
21
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 18

def initialize(type_constraints, ext_constraints)
  self.type = type_constraints || []
  self.ext = ext_constraints || []
end

Instance Attribute Details

#extObject

array



11
12
13
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 11

def ext
  @ext
end

#typeObject

array



10
11
12
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 10

def type
  @type
end

Instance Method Details

#mergedObject

all constraints inherited by members of the extension



14
15
16
# File 'lib/jazzy/symbol_graph/ext_node.rb', line 14

def merged
  (type + ext).sort
end