Class: EBPS::Text::MultiCell

Inherits:
Object
  • Object
show all
Defined in:
lib/ebps/text/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_spanObject

Returns the value of attribute col_span.



17
18
19
# File 'lib/ebps/text/table.rb', line 17

def col_span
  @col_span
end

#contentsObject

Returns the value of attribute contents.



17
18
19
# File 'lib/ebps/text/table.rb', line 17

def contents
  @contents
end

#row_spanObject

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

Returns:

  • (Boolean)


27
28
29
# File 'lib/ebps/text/table.rb', line 27

def empty?
  @contents.empty?
end

#lengthObject



30
31
32
# File 'lib/ebps/text/table.rb', line 30

def length
  @contents.length
end

#preformatted?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/ebps/text/table.rb', line 47

def preformatted?
  false
end

#textObject



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