Class: Coradoc::Html::Drop::Base

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/coradoc/html/drop/base.rb

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

#modelObject (readonly)

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

#idObject



28
29
30
# File 'lib/coradoc/html/drop/base.rb', line 28

def id
  @model.id
end

#template_typeObject



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

#titleObject



32
33
34
# File 'lib/coradoc/html/drop/base.rb', line 32

def title
  optional_text(@model.title)
end

#to_liquidObject



15
16
17
# File 'lib/coradoc/html/drop/base.rb', line 15

def to_liquid
  self
end