Class: TTY::Table::Operation::Padding
- Inherits:
-
Object
- Object
- TTY::Table::Operation::Padding
- Defined in:
- lib/tty/table/operation/padding.rb
Overview
A class responsible for padding field with whitespace
Used internally by Renderer
Instance Method Summary collapse
-
#call(field) ⇒ TTY::Table::Field
Apply padding to a field.
-
#initialize(padding) ⇒ Padding
constructor
Initialize a Padding operation.
Constructor Details
#initialize(padding) ⇒ Padding
Initialize a Padding operation
17 18 19 |
# File 'lib/tty/table/operation/padding.rb', line 17 def initialize(padding) @padding = padding end |
Instance Method Details
#call(field) ⇒ TTY::Table::Field
Apply padding to a field
29 30 31 |
# File 'lib/tty/table/operation/padding.rb', line 29 def call(field, *) Strings.pad(field.content, padding) end |