Cross Reference:
xref
: /
ontohub
/
app
/
helpers
/
entity_helper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
entity_helper.rb revision 9768e1d58479816d766aa28af4f117478f59e735
module
EntityHelper
def
show_classes
?
return
params
[:
kind
] !=
"Class"
end
def
name_highlighter
(
entity
)
if
entity.name
==
entity.text
string
=
entity.text
else
string
=
content_tag
(:
strong
,
entity.name
,
class
:
'entity_highlight'
)
end
h
(
entity.text
)
.
gsub
(/\b
#{
entity.name
}\b/, string).html_safe
end
def
choose_default_entity_kind
(
entity_kinds
)
raw_entity_kinds
=
entity_kinds.map
{ |e|
e.try
(:
kind
)
||
e.to
_s
}
if
raw_entity_kinds.include
?
(
'Class'
)
'Class'
else
entity_kinds.first.kind
end
end
end