Class: Rocx::Parts::Styles
- Defined in:
- lib/rocx/parts/styles.rb
Instance Attribute Summary collapse
-
#styles ⇒ Object
readonly
Returns the value of attribute styles.
Instance Method Summary collapse
- #<<(style) ⇒ Object
-
#initialize ⇒ Styles
constructor
A new instance of Styles.
- #to_xml ⇒ Object
Methods inherited from BasePart
#build_standalone_xml, #build_xml, #read
Constructor Details
#initialize ⇒ Styles
Returns a new instance of Styles.
6 7 8 |
# File 'lib/rocx/parts/styles.rb', line 6 def initialize @styles = [] end |
Instance Attribute Details
#styles ⇒ Object (readonly)
Returns the value of attribute styles.
4 5 6 |
# File 'lib/rocx/parts/styles.rb', line 4 def styles @styles end |
Instance Method Details
#<<(style) ⇒ Object
10 11 12 |
# File 'lib/rocx/parts/styles.rb', line 10 def <<(style) @styles << style end |
#to_xml ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rocx/parts/styles.rb', line 14 def to_xml build_standalone_xml do |xml| xml.styles(root_namespaces) { xml.parent.namespace = xml.parent.namespace_definitions.find { |ns| ns.prefix == "w" } add_default_styles(xml) styles.each { |style| style.build_xml(xml) } } end end |