Class: TextLayout::Table::Cell

Inherits:
Struct
  • Object
show all
Defined in:
lib/text_layout/table.rb

Direct Known Subclasses

Span

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attrObject

Returns the value of attribute attr

Returns:

  • (Object)

    the current value of attr



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

def attr
  @attr
end

#colObject

Returns the value of attribute col

Returns:

  • (Object)

    the current value of col



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

def col
  @col
end

#rowObject

Returns the value of attribute row

Returns:

  • (Object)

    the current value of row



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

def row
  @row
end

Instance Method Details

#heightObject



35
36
37
# File 'lib/text_layout/table.rb', line 35

def height
  [attr[:value].size, 1].max
end

#widthObject



31
32
33
# File 'lib/text_layout/table.rb', line 31

def width
  attr[:value].map(&:display_width).max || 0
end