Class: BerkeleyLibrary::Util::ODS::XML::Style::ColumnStyle

Inherits:
Style show all
Defined in:
lib/berkeley_library/util/ods/xml/style/column_style.rb

Constant Summary collapse

DEFAULT_WIDTH =
'1in'.freeze

Instance Attribute Summary collapse

Attributes inherited from Style

#family, #style_name

Attributes inherited from ElementNode

#doc, #element_name, #namespace

Instance Method Summary collapse

Methods inherited from Style

#<=>

Methods inherited from ElementNode

#add_child, #attributes, #children, #clear_attribute, #create_element, #element, #ensure_element!, #prefix, #prefixed_attr_name, #set_attribute

Constructor Details

#initialize(style_name, width = nil, styles:) ⇒ ColumnStyle

Initializes a new column style. Note that this should not be called directly, but only from Office::AutomaticStyles#add_column_style.

Parameters:

  • style_name (String)

    the name of the style

  • width (String) (defaults to: nil)

    the column width

  • styles (XML::Office::AutomaticStyles)

    the document styles



20
21
22
23
24
# File 'lib/berkeley_library/util/ods/xml/style/column_style.rb', line 20

def initialize(style_name, width = nil, styles:)
  super(style_name, :table_column, doc: styles.doc)
  @width = width || DEFAULT_WIDTH
  add_default_children!
end

Instance Attribute Details

#widthObject (readonly)

Returns the value of attribute width.



12
13
14
# File 'lib/berkeley_library/util/ods/xml/style/column_style.rb', line 12

def width
  @width
end