class BerkeleyLibrary::Util::ODS::XML::Office::DocumentStyles

Constants

REQUIRED_NAMESPACES

Public Class Methods

new(doc:) click to toggle source
# File lib/berkeley_library/util/ods/xml/office/document_styles.rb, line 13
def initialize(doc:)
  super(:office, 'document-styles', doc: doc)

  set_default_attributes!
  add_default_children!
end

Private Instance Methods

add_default_children!() click to toggle source
# File lib/berkeley_library/util/ods/xml/office/document_styles.rb, line 30
def add_default_children!
  add_child(FontFaceDecls.new(doc: doc))
  add_child(Styles.new(doc: doc))
end
required_namespaces() click to toggle source
# File lib/berkeley_library/util/ods/xml/office/document_styles.rb, line 22
def required_namespaces
  @required_namespaces ||= REQUIRED_NAMESPACES.map { |p| Namespace.for_prefix(p) }
end
set_default_attributes!() click to toggle source
# File lib/berkeley_library/util/ods/xml/office/document_styles.rb, line 26
def set_default_attributes!
  required_namespaces.each { |ns| set_attribute(:xmlns, ns.prefix, ns.uri) }
end