Class: RODF::StyleSection
- Inherits:
-
Object
- Object
- RODF::StyleSection
- Defined in:
- lib/rodf/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.
22 23 24 25 26 27 28 29 |
# File 'lib/rodf/style_section.rb', line 22 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
35 36 37 |
# File 'lib/rodf/style_section.rb', line 35 def make_element_attributes(opts) {'number:style' => opts[:style], 'number:textual' => opts[:textual]} end |
#xml ⇒ Object
31 32 33 |
# File 'lib/rodf/style_section.rb', line 31 def xml Builder::XmlMarkup.new.number @type, @content, @elem_attrs end |