Class: Helium::Console::KeyValue::TableFormatter
- Inherits:
-
Object
- Object
- Helium::Console::KeyValue::TableFormatter
- Includes:
- ColorizedString::Helpers
- Defined in:
- lib/helium/console/key_value.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(key_value, console:, level:, left:, between:, right:, max_width:, key_options: {}, value_options: {}) ⇒ TableFormatter
constructor
A new instance of TableFormatter.
Methods included from ColorizedString::Helpers
Constructor Details
#initialize(key_value, console:, level:, left:, between:, right:, max_width:, key_options: {}, value_options: {}) ⇒ TableFormatter
Returns a new instance of TableFormatter.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/helium/console/key_value.rb', line 35 def initialize( key_value, console:, level:, left:, between:, right:, max_width:, key_options: {}, value_options: {} ) @key_value = key_value @console = console @left = left @between = between @right = right @max_width = max_width @key_options = @level = level @value_options = set_width_limits end |
Class Method Details
.call(*args, **options) ⇒ Object
31 32 33 |
# File 'lib/helium/console/key_value.rb', line 31 def self.call(*args, **) new(*args, **).() end |
Instance Method Details
#call ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/helium/console/key_value.rb', line 59 def call Formatter::LazyStringEvaluator.new do |y| key_value.rows.each do |key, value, | format_entry(y, key, value, **) end end end |