Class: Coradoc::Html::Drop::DefinitionItemDrop

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

Constructor Details

This class inherits a constructor from Coradoc::Html::Drop::Base

Instance Method Details

#definitionsObject



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

#termObject



7
8
9
# File 'lib/coradoc/html/drop/definition_item_drop.rb', line 7

def term
  Escape.escape_html(stripped_term)
end

#term_idObject



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