Class: Coradoc::Html::Drop::Base
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Coradoc::Html::Drop::Base
show all
- Defined in:
- lib/coradoc/html/drop/base.rb
Direct Known Subclasses
AnnotationDrop, BibliographyDrop, BibliographyEntryDrop, BlockDrop, DefinitionItemDrop, DefinitionListDrop, DocumentDrop, FootnoteDrop, ImageDrop, InlineElementDrop, ListBlockDrop, ListItemDrop, TableCellDrop, TableDrop, TableRowDrop, TermDrop, TextContentDrop, TocDrop, TocEntryDrop
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(model) ⇒ Base
Returns a new instance of Base.
11
12
13
|
# File 'lib/coradoc/html/drop/base.rb', line 11
def initialize(model)
@model = model
end
|
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
9
10
11
|
# File 'lib/coradoc/html/drop/base.rb', line 9
def model
@model
end
|
Instance Method Details
#id ⇒ Object
28
29
30
|
# File 'lib/coradoc/html/drop/base.rb', line 28
def id
@model.id
end
|
#template_type ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/coradoc/html/drop/base.rb', line 19
def template_type
self.class.name
.split('::').last
.sub(/Drop$/, '')
.gsub(/([A-Z])/, '_\1')
.downcase
.sub(/^_/, '')
end
|
#title ⇒ Object
32
33
34
|
# File 'lib/coradoc/html/drop/base.rb', line 32
def title
optional_text(@model.title)
end
|
#to_liquid ⇒ Object
15
16
17
|
# File 'lib/coradoc/html/drop/base.rb', line 15
def to_liquid
self
end
|