213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zelenymodule SymbolHelper
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny def show_classes?(kind = params[:kind])
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny kind == 'Class'
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny end
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny def name_highlighter(symbol)
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny if symbol.name == symbol.text
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny string = symbol.text
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny else
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny string = content_tag(:strong, symbol.name, class: 'symbol_highlight')
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny end
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny h(symbol.text).gsub(/\b#{symbol.name}\b/, string).html_safe
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny end
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny def choose_default_symbol_kind(symbol_kinds)
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny raw_symbol_kinds = symbol_kinds.map { |e| e.try(:kind) || e.to_s }
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny if raw_symbol_kinds.include?('Class')
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny 'Class'
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny else
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny symbol_kinds.first.kind
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny end
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny end
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zelenyend
213ce2a78b1abe3921d8dc13c949a28130d00aecJan Zeleny