Class: Uniword::Footer
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Uniword::Footer
- Defined in:
- lib/uniword/footer.rb
Overview
Represents a document footer Footers can contain paragraphs, tables, and fields (like page numbers)
Constant Summary collapse
- TYPES =
Valid footer types
%w[default first even].freeze
Instance Method Summary collapse
-
#elements ⇒ Object
Get all content elements (paragraphs and tables) in order.
-
#empty? ⇒ Boolean
Check if footer is empty.
-
#initialize(**attributes) ⇒ Footer
constructor
A new instance of Footer.
Constructor Details
#initialize(**attributes) ⇒ Footer
Returns a new instance of Footer.
18 19 20 21 |
# File 'lib/uniword/footer.rb', line 18 def initialize(**attributes) super validate_type end |
Instance Method Details
#elements ⇒ Object
Get all content elements (paragraphs and tables) in order
24 25 26 27 28 |
# File 'lib/uniword/footer.rb', line 24 def elements (paragraphs + tables).sort_by do |elem| paragraphs.index(elem) || (tables.index(elem) + paragraphs.size) end end |
#empty? ⇒ Boolean
Check if footer is empty
31 32 33 |
# File 'lib/uniword/footer.rb', line 31 def empty? paragraphs.empty? && tables.empty? end |