Class: Rocx::Style
- Inherits:
-
Object
- Object
- Rocx::Style
- Defined in:
- lib/rocx/style.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#paragraph ⇒ Object
readonly
Returns the value of attribute paragraph.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #build_xml(xml) ⇒ Object
-
#initialize(name, type, run = {}, paragraph = {}) ⇒ Style
constructor
A new instance of Style.
Constructor Details
#initialize(name, type, run = {}, paragraph = {}) ⇒ Style
Returns a new instance of Style.
5 6 7 8 9 10 |
# File 'lib/rocx/style.rb', line 5 def initialize(name, type, run={}, paragraph={}) @name = name @type = type @run = run @paragraph = paragraph end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rocx/style.rb', line 3 def name @name end |
#paragraph ⇒ Object (readonly)
Returns the value of attribute paragraph.
3 4 5 |
# File 'lib/rocx/style.rb', line 3 def paragraph @paragraph end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
3 4 5 |
# File 'lib/rocx/style.rb', line 3 def run @run end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/rocx/style.rb', line 3 def type @type end |
Instance Method Details
#build_xml(xml) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/rocx/style.rb', line 12 def build_xml(xml) xml["w"].style("w:styleId" => name, "w:type" => type) { xml["w"].name("w:val" => name) paragraph_as_xml(xml) run_as_xml(xml) } end |