Class | SimpleCell |
In: |
lib/simple_cell.rb
|
Parent: | Object |
link | [RW] | |
style | [RW] |
# 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
行ごとに block を呼ぶ。
# File lib/simple_cell.rb, line 15 15: def each_line(&block) 16: @text.each(&block) 17: end
option[:array] が真なら行ごとの配列、そうでなければ文字列を返す。
# File lib/simple_cell.rb, line 20 20: def text(option={}) 21: option[:array] ? @text : @text.join("\n") 22: end