Class: RODF::Paragraph

Inherits:
ParagraphContainer show all
Defined in:
lib/rodf/paragraph.rb

Instance Method Summary collapse

Methods inherited from ParagraphContainer

#<<, #content_parts, #content_parts_xml, #link, #method_missing, #span, #tab

Methods inherited from Container

create

Constructor Details

#initialize(fst = nil, snd = {}) ⇒ Paragraph

Returns a new instance of Paragraph.



3
4
5
6
7
8
9
10
11
# File 'lib/rodf/paragraph.rb', line 3

def initialize(fst = nil, snd = {})
  super

  first_is_hash = fst.instance_of?(Hash)

  span(fst) unless first_is_hash

  @elem_attrs = make_element_attributes(first_is_hash ? fst : snd)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RODF::ParagraphContainer

Instance Method Details

#xmlObject



13
14
15
16
17
# File 'lib/rodf/paragraph.rb', line 13

def xml
  Builder::XmlMarkup.new.text:p, @elem_attrs do |xml|
    xml << content_parts_xml
  end
end