Class: FixedWidthColumns::Config
- Inherits:
-
Aduki::Initializable
- Object
- Aduki::Initializable
- FixedWidthColumns::Config
- Defined in:
- lib/fixed_width_columns/config.rb
Constant Summary collapse
- @@export_configs =
{ }
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
Returns the value of attribute name.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
5 6 7 |
# File 'lib/fixed_width_columns/config.rb', line 5 def label @label end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fixed_width_columns/config.rb', line 5 def name @name end |
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/fixed_width_columns/config.rb', line 5 def target @target end |
Instance Method Details
#headers?(header) ⇒ Boolean
14 |
# File 'lib/fixed_width_columns/config.rb', line 14 def headers? header ; header ? [formatter.headers] : [] ; end |
#pre_process(items) ⇒ Object
15 |
# File 'lib/fixed_width_columns/config.rb', line 15 def pre_process items ; (preprocessors || []).inject(items) { |list, pp| pp.apply list } ; end |
#to_text(items, header = nil) ⇒ Object
9 10 11 |
# File 'lib/fixed_width_columns/config.rb', line 9 def to_text items, header=nil pre_process(items).inject(headers? header) { |ll, i| ll << formatter.format(i) }.join "\n" end |