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(attrs = {}) ⇒ BlockElementDrop

Returns a new instance of BlockElementDrop.



9
10
11
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 9

def initialize(attrs = {})
  attrs.each { |k, v| instance_variable_set(:"@#{k}", v) }
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)


14
15
16
# File 'lib/metanorma/html/drops/block_element_drop.rb', line 14

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