Class: Formatting::CellFormatter
- Inherits:
-
Object
- Object
- Formatting::CellFormatter
- Defined in:
- lib/formatting.rb
Overview
CellFormatter class format data in cell
Class Method Summary collapse
-
.format_value(value, opts) ⇒ String
Formatted string value.
Class Method Details
.format_value(value, opts) ⇒ String
Returns Formatted string value.
31 32 33 34 35 36 37 38 |
# File 'lib/formatting.rb', line 31 def self.format_value(value,opts) if opts.has_key?(:format) cell = sprintf(opts[:format],value) else cell = sprintf("%#{opts[:max_width]}s",value) end Formatting.format_value_by_width_and_just(cell,opts[:max_width],opts[:just]) end |