Class SimpleCell
In: lib/simple_cell.rb
Parent: Object

PDF 文書のテーブルのセルのモデル。

Methods

each_line   line_num   new   text   text=  

Attributes

link  [RW] 
style  [RW] 

Public Class methods

[Source]

   # File lib/simple_cell.rb, line 3
3:   def initialize(text, style=nil, link=nil)
4:     self.text = text
5:     @style = style ? style.dup : SimpleCellStyle.new
6:     @link = link ? link.dup : ""
7:   end

Public Instance methods

行ごとに block を呼ぶ。

[Source]

    # File lib/simple_cell.rb, line 15
15:   def each_line(&block)
16:     @text.each(&block)
17:   end

行数。

[Source]

    # File lib/simple_cell.rb, line 10
10:   def line_num
11:     @text.size
12:   end

option[:array] が真なら行ごとの配列、そうでなければ文字列を返す。

[Source]

    # File lib/simple_cell.rb, line 20
20:   def text(option={})
21:     option[:array] ? @text : @text.join("\n")
22:   end

new_text を格納する。

[Source]

    # File lib/simple_cell.rb, line 25
25:   def text=(new_text)
26:     @text = new_text.is_a?(Array) ? new_text : new_text.to_s.split(/\r?\n|\r/, -1)
27:   end

[Validate]