Class: FormatR::CenterFormatter
Overview
Format things that go to the center, ala |
Instance Method Summary collapse
-
#formatString(s, var_name, binding) ⇒ Object
center things.
-
#initialize(val) ⇒ CenterFormatter
constructor
A new instance of CenterFormatter.
Methods inherited from Formatter
Constructor Details
#initialize(val) ⇒ CenterFormatter
Returns a new instance of CenterFormatter.
638 639 640 641 |
# File 'lib/formatr.rb', line 638 def initialize (val) super @len = val.size() end |
Instance Method Details
#formatString(s, var_name, binding) ⇒ Object
center things
644 645 646 647 |
# File 'lib/formatr.rb', line 644 def formatString (s, var_name, binding) s = super s.center(@len) end |