Class: RODF::ParagraphContainer
- Inherits:
-
Container
show all
- Defined in:
- lib/rodf/paragraph_container.rb,
lib/rodf/tab.rb,
lib/rodf/hyperlink.rb
Overview
Container for all kinds of paragraph content
Instance Method Summary
collapse
Methods inherited from Container
create, #initialize
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(style, *args) ⇒ Object
26
27
28
|
# File 'lib/rodf/paragraph_container.rb', line 26
def method_missing(style, *args)
span(style, *args)
end
|
Instance Method Details
#<<(content) ⇒ Object
22
23
24
|
# File 'lib/rodf/paragraph_container.rb', line 22
def <<(content)
span(content)
end
|
#content_parts ⇒ Object
4
5
6
|
# File 'lib/rodf/paragraph_container.rb', line 4
def content_parts
@content_parts ||= []
end
|
#content_parts_xml ⇒ Object
8
9
10
|
# File 'lib/rodf/paragraph_container.rb', line 8
def content_parts_xml
content_parts.map {|p| p.xml}.join
end
|
#link(*args) {|l| ... } ⇒ Object
Also known as:
a
22
23
24
25
26
27
28
29
30
|
# File 'lib/rodf/hyperlink.rb', line 22
def link(*args)
l = Hyperlink.new(*args)
yield l if block_given?
content_parts << l
l
end
|
#span(*args) {|s| ... } ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/rodf/paragraph_container.rb', line 12
def span(*args)
s = Span.new(*args)
yield s if block_given?
content_parts << s
s
end
|
#tab(*args) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/rodf/tab.rb', line 9
def tab(*args)
t = Tab.new
content_parts << t
t
end
|