Class: Metanorma::Html::Drops::BlockElementDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/metanorma/html/drops/block_element_drop.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, type: nil, label_html: nil, content_html: nil, css_class: nil) ⇒ BlockElementDrop

Returns a new instance of BlockElementDrop.



9
10
11
12
13
14
15
16
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 9

def initialize(id: nil, type: nil, label_html: nil, content_html: nil,
css_class: nil)
  @id = id
  @type = type
  @label_html = label_html
  @content_html = content_html
  @css_class = css_class
end

Instance Attribute Details

#content_htmlObject (readonly)

Returns the value of attribute content_html.



7
8
9
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 7

def content_html
  @content_html
end

#css_classObject (readonly)

Returns the value of attribute css_class.



7
8
9
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 7

def css_class
  @css_class
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 7

def id
  @id
end

#label_htmlObject (readonly)

Returns the value of attribute label_html.



7
8
9
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 7

def label_html
  @label_html
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 7

def type
  @type
end

Class Method Details

.from_model(_model, renderer:) ⇒ Object

Subclasses override to build from model + RendererContext

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 19

def self.from_model(_model, renderer:)
  raise NotImplementedError, "#{name} must implement .from_model"
end