Class: TTY::Table::Operation::Alignment
- Inherits:
-
Object
- Object
- TTY::Table::Operation::Alignment
- Defined in:
- lib/tty/table/operation/alignment.rb
Overview
A class which responsiblity is to align table rows and header.
Constant Summary collapse
- DEFAULT =
:left
Instance Method Summary collapse
-
#call(field, row, col) ⇒ TTY::Table::Field
Evaluate alignment of the provided row.
-
#initialize(alignments, widths = nil) ⇒ Alignment
constructor
private
Initialize an Alignment operation.
Constructor Details
#initialize(alignments, widths = nil) ⇒ Alignment
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize an Alignment operation
15 16 17 18 |
# File 'lib/tty/table/operation/alignment.rb', line 15 def initialize(alignments, widths = nil) @alignments = alignments @widths = widths end |
Instance Method Details
#call(field, row, col) ⇒ TTY::Table::Field
Evaluate alignment of the provided row
34 35 36 |
# File 'lib/tty/table/operation/alignment.rb', line 34 def call(field, row, col) align_field(field, col) end |