Class: RubyJard::Column

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ruby_jard/column.rb

Overview

This class is an object to contain information of a column in a data drow display on a screen

Constant Summary collapse

WORD_WRAP_NORMAL =

Only break at breakable word | this_is_a <endline> | | really_long_content |

:normal
WORD_WRAP_BREAK_WORD =

Break the word, and move the rest to the next line | this_is_a really_lon| | g_content |

:break_word

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spans: [], word_wrap: WORD_WRAP_NORMAL) ⇒ Column

Returns a new instance of Column.



19
20
21
22
23
24
# File 'lib/ruby_jard/column.rb', line 19

def initialize(spans: [], word_wrap: WORD_WRAP_NORMAL)
  @spans = spans
  @width = 0
  @content_length = 0
  @word_wrap = word_wrap
end

Instance Attribute Details

#content_lengthObject

Returns the value of attribute content_length.



17
18
19
# File 'lib/ruby_jard/column.rb', line 17

def content_length
  @content_length
end

#content_widthObject

Returns the value of attribute content_width.



17
18
19
# File 'lib/ruby_jard/column.rb', line 17

def content_width
  @content_width
end

#spansObject

Returns the value of attribute spans.



17
18
19
# File 'lib/ruby_jard/column.rb', line 17

def spans
  @spans
end

#widthObject

Returns the value of attribute width.



17
18
19
# File 'lib/ruby_jard/column.rb', line 17

def width
  @width
end

#word_wrapObject

Returns the value of attribute word_wrap.



17
18
19
# File 'lib/ruby_jard/column.rb', line 17

def word_wrap
  @word_wrap
end