Sha256: 442ff8fe5411daeab0ed4c885cb348a11109ef22c492d459d1cd18fd2eab3756

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require 'berkeley_library/util/ods/xml/element_node'

module BerkeleyLibrary
  module Util
    module ODS
      module XML
        module Style
          class TableCellProperties < ElementNode

            # rubocop:disable Style/KeywordParametersOrder
            def initialize(protected, wrap: false, doc:)
              super(:style, 'table-cell-properties', doc: doc)
              @protected = protected
              @wrap = wrap
              set_default_attributes!
            end
            # rubocop:enable Style/KeywordParametersOrder

            def protected?
              @protected
            end

            def wrap?
              @wrap
            end

            private

            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
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
berkeley_library-tind-0.7.2 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.7.1 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.7.0 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.6.0 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.5.1 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.5.0 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.4.3 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.4.2 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.4.1 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb
berkeley_library-tind-0.4.0 lib/berkeley_library/util/ods/xml/style/table_cell_properties.rb