Class: FormatR::RightFormatter

Inherits:
Formatter show all
Defined in:
lib/formatr.rb

Overview

Format things that go to the right, ala >

Instance Method Summary collapse

Methods inherited from Formatter

#changeVarValue, #setVarValue

Constructor Details

#initialize(val) ⇒ RightFormatter

Returns a new instance of RightFormatter.



624
625
626
627
# File 'lib/formatr.rb', line 624

def initialize (val)
  super
  @len = val.size()
end

Instance Method Details

#formatString(s, var_name, binding) ⇒ Object

send things right



630
631
632
633
# File 'lib/formatr.rb', line 630

def formatString (s, var_name, binding)
  s = super 
  s.rjust(@len)
end