Class: Coradoc::Html::Drop::DefinitionItemDrop
- Inherits:
-
Base
- Object
- Liquid::Drop
- Base
- Coradoc::Html::Drop::DefinitionItemDrop
show all
- Defined in:
- lib/coradoc/html/drop/definition_item_drop.rb
Instance Attribute Summary
Attributes inherited from Base
#model
Instance Method Summary
collapse
Methods inherited from Base
#id, #initialize, #template_type, #title, #to_liquid
Instance Method Details
#definitions ⇒ Object
16
17
18
19
20
|
# File 'lib/coradoc/html/drop/definition_item_drop.rb', line 16
def definitions
return [] unless @model.definitions
@model.definitions.map { |d| content_to_liquid(d) }
end
|
#term ⇒ Object
7
8
9
|
# File 'lib/coradoc/html/drop/definition_item_drop.rb', line 7
def term
Escape.escape_html(stripped_term)
end
|
#term_id ⇒ Object
11
12
13
14
|
# File 'lib/coradoc/html/drop/definition_item_drop.rb', line 11
def term_id
match = term_text.match(/\A\[\[([^\]]+)\]\]/)
match&.[](1)
end
|