Class: BerkeleyLibrary::Util::ODS::XML::Style::TextProperties
- Inherits:
-
ElementNode
- Object
- ElementNode
- BerkeleyLibrary::Util::ODS::XML::Style::TextProperties
- Defined in:
- lib/berkeley_library/util/ods/xml/style/text_properties.rb
Constant Summary collapse
- FONT_WEIGHT_ATTRS =
%w[font-weight font-weight-asian font-weight-complex].freeze
- COLOR_RE =
/^#[[:xdigit:]]{6}$/.freeze
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#font_name ⇒ Object
readonly
Returns the value of attribute font_name.
-
#font_weight ⇒ Object
readonly
Returns the value of attribute font_weight.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
Attributes inherited from ElementNode
#doc, #element_name, #namespace
Instance Method Summary collapse
-
#initialize(color: nil, font_name: nil, font_weight: nil, language: 'en', country: 'US', doc:) ⇒ TextProperties
constructor
rubocop:disable Metrics/ParameterLists, Style/KeywordParametersOrder.
Methods inherited from ElementNode
#add_child, #attributes, #children, #clear_attribute, #create_element, #element, #ensure_element!, #prefix, #prefixed_attr_name, #set_attribute
Constructor Details
#initialize(color: nil, font_name: nil, font_weight: nil, language: 'en', country: 'US', doc:) ⇒ TextProperties
rubocop:disable Metrics/ParameterLists, Style/KeywordParametersOrder
16 17 18 19 20 21 22 23 24 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 16 def initialize(color: nil, font_name: nil, font_weight: nil, language: 'en', country: 'US', doc:) super(:style, 'text-properties', doc: doc) @color = ensure_color(color) @font_name = font_name @language = language @country = country @font_weight = font_weight set_default_attributes! end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
13 14 15 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 13 def color @color end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
13 14 15 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 13 def country @country end |
#font_name ⇒ Object (readonly)
Returns the value of attribute font_name.
13 14 15 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 13 def font_name @font_name end |
#font_weight ⇒ Object (readonly)
Returns the value of attribute font_weight.
13 14 15 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 13 def font_weight @font_weight end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
13 14 15 |
# File 'lib/berkeley_library/util/ods/xml/style/text_properties.rb', line 13 def language @language end |