Class: ODF::StyleSection
- Inherits:
-
Object
- Object
- ODF::StyleSection
- Defined in:
- lib/odf/style_section.rb
Instance Method Summary collapse
-
#initialize(type, second = {}) ⇒ StyleSection
constructor
A new instance of StyleSection.
- #make_element_attributes(opts) ⇒ Object
- #xml ⇒ Object
Constructor Details
#initialize(type, second = {}) ⇒ StyleSection
Returns a new instance of StyleSection.
24 25 26 27 28 29 30 31 |
# File 'lib/odf/style_section.rb', line 24 def initialize(type, second = {}) @type = type if second.instance_of?(Hash) @elem_attrs = make_element_attributes(second) else @content, @elem_attrs = second, {} end end |
Instance Method Details
#make_element_attributes(opts) ⇒ Object
37 38 39 |
# File 'lib/odf/style_section.rb', line 37 def make_element_attributes(opts) {'number:style' => opts[:style], 'number:textual' => opts[:textual]} end |
#xml ⇒ Object
33 34 35 |
# File 'lib/odf/style_section.rb', line 33 def xml Builder::XmlMarkup.new.number @type, @content, @elem_attrs end |