Class: ODF::Span
- Inherits:
-
ParagraphContainer
- Object
- Container
- ParagraphContainer
- ODF::Span
- Defined in:
- lib/odf/span.rb
Instance Method Summary collapse
-
#initialize(first, second = nil) ⇒ Span
constructor
A new instance of Span.
- #xml ⇒ Object
Methods inherited from ParagraphContainer
#<<, #content_parts, #content_parts_xml, #link, #method_missing, #span, #tab
Methods inherited from Container
Constructor Details
#initialize(first, second = nil) ⇒ Span
Returns a new instance of Span.
36 37 38 39 40 41 42 43 |
# File 'lib/odf/span.rb', line 36 def initialize(first, second = nil) if first.instance_of?(Symbol) @style = first content_parts << TextNode.new(second) unless second.nil? else content_parts << TextNode.new(first) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ODF::ParagraphContainer
Instance Method Details
#xml ⇒ Object
45 46 47 48 49 50 |
# File 'lib/odf/span.rb', line 45 def xml return content_parts_xml if @style.nil? Builder::XmlMarkup.new.text:span, 'text:style-name' => @style do |xml| xml << content_parts_xml end end |