Class: Odf::Element::Heading

Inherits:
Abstract show all
Includes:
AbstractContenteable
Defined in:
lib/odf/element/heading.rb

Constant Summary collapse

XML_TAG =
'text:h'.freeze

Instance Attribute Summary

Attributes inherited from Abstract

#parent, #root

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract

#document, #valid_options, #xml_tag

Constructor Details

#initialize(parent, content, options = {}) ⇒ Heading

Returns a new instance of Heading.



12
13
14
15
# File 'lib/odf/element/heading.rb', line 12

def initialize(parent, content, options = {})
  options = { level: 1 }.merge(options)
  super(parent, content, options)
end

Class Method Details

.build(parent, text, options = {}) ⇒ Object



8
9
10
# File 'lib/odf/element/heading.rb', line 8

def self.build(parent, text, options = {})
  new(parent, text, options)
end