class BerkeleyLibrary::Util::ODS::XML::Style::TableCellProperties

Public Class Methods

new(protected, wrap: false, doc:) click to toggle source

rubocop:disable Style/KeywordParametersOrder

# File lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb, line 11
def initialize(protected, wrap: false, doc:)
  super(:style, 'table-cell-properties', doc: doc)
  @protected = protected
  @wrap = wrap
  set_default_attributes!
end

Public Instance Methods

protected?() click to toggle source

rubocop:enable Style/KeywordParametersOrder

# File lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb, line 19
def protected?
  @protected
end
wrap?() click to toggle source
# File lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb, line 23
def wrap?
  @wrap
end

Private Instance Methods

set_default_attributes!() click to toggle source
# File lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb, line 29
def set_default_attributes!
  set_attribute(:style, 'cell-protect', protected? ? 'protected' : 'none')
  set_attribute(:style, 'vertical-align', 'top')
  set_attribute('print-content', 'true')
  set_attribute(:fo, 'wrap-option', 'wrap') if wrap?
end