Method: Jazzy::SymbolGraph::Symbol#init_constraints
- Defined in:
- lib/jazzy/symbol_graph/symbol.rb
#init_constraints(hash, raw_decl) ⇒ Object
Generic constraints: in one or both of two places. There can be duplicates; these are removed by ‘Constraint`.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/jazzy/symbol_graph/symbol.rb', line 151 def init_constraints(hash, raw_decl) raw_constraints = %i[swiftGenerics swiftExtension].flat_map do |key| next [] unless container = hash[key] container[:constraints] || [] end constraints = Constraint.new_list_for_symbol(raw_constraints, path_components) if raw_decl =~ / where (.*)$/ constraints += Constraint.new_list_from_declaration(Regexp.last_match[1]) end self.constraints = constraints.sort.uniq end |