Class: Formatting::HeaderFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/formatting.rb

Overview

CellFormatter class format field name in header

Class Method Summary collapse

Class Method Details

.format_value(value, opts) ⇒ String

Returns Formatted string value.

Parameters:

  • String (String)

    value for formatting

  • opts (Hash)

    options: format, max width, alignment

Returns:

  • (String)

    Formatted string value



47
48
49
50
# File 'lib/formatting.rb', line 47

def self.format_value(value,opts)
  field = value.gsub('_',' ')
  Formatting.format_value_by_width_and_just(field,opts[:max_width],opts[:just])
end