Class: EBPS::Text::MultiCell
- Inherits:
-
Object
- Object
- EBPS::Text::MultiCell
- Defined in:
- lib/ebps/text/table.rb
Instance Attribute Summary collapse
-
#col_span ⇒ Object
Returns the value of attribute col_span.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#row_span ⇒ Object
Returns the value of attribute row_span.
Instance Method Summary collapse
- #<<(args) ⇒ Object
- #[](*args) ⇒ Object
- #clear! ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(*args) ⇒ MultiCell
constructor
A new instance of MultiCell.
- #length ⇒ Object
- #preformatted? ⇒ Boolean
- #text ⇒ Object
Constructor Details
#initialize(*args) ⇒ MultiCell
Returns a new instance of MultiCell.
18 19 20 21 22 23 |
# File 'lib/ebps/text/table.rb', line 18 def initialize(*args) @col_span = 1 @row_span = 1 @contents = [] clear! end |
Instance Attribute Details
#col_span ⇒ Object
Returns the value of attribute col_span.
17 18 19 |
# File 'lib/ebps/text/table.rb', line 17 def col_span @col_span end |
#contents ⇒ Object
Returns the value of attribute contents.
17 18 19 |
# File 'lib/ebps/text/table.rb', line 17 def contents @contents end |
#row_span ⇒ Object
Returns the value of attribute row_span.
17 18 19 |
# File 'lib/ebps/text/table.rb', line 17 def row_span @row_span end |
Instance Method Details
#<<(args) ⇒ Object
33 34 35 36 |
# File 'lib/ebps/text/table.rb', line 33 def << args @contents << args self end |
#[](*args) ⇒ Object
37 38 39 |
# File 'lib/ebps/text/table.rb', line 37 def [] *args @contents[*args] end |
#clear! ⇒ Object
24 25 26 |
# File 'lib/ebps/text/table.rb', line 24 def clear! @contents.clear end |
#empty? ⇒ Boolean
27 28 29 |
# File 'lib/ebps/text/table.rb', line 27 def empty? @contents.empty? end |
#length ⇒ Object
30 31 32 |
# File 'lib/ebps/text/table.rb', line 30 def length @contents.length end |
#preformatted? ⇒ Boolean
47 48 49 |
# File 'lib/ebps/text/table.rb', line 47 def preformatted? false end |
#text ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/ebps/text/table.rb', line 40 def text text = '' @contents.map do |content| text << content.text if content.is_a? Paragraph end text end |