Class: KPM::Formatter::DefaultFormatter
- Inherits:
-
Object
- Object
- KPM::Formatter::DefaultFormatter
- Defined in:
- lib/kpm/formatter.rb
Overview
Used for normal types where to_s is enough
Instance Method Summary collapse
-
#initialize(label, input) ⇒ DefaultFormatter
constructor
A new instance of DefaultFormatter.
- #label ⇒ Object
- #size ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(label, input) ⇒ DefaultFormatter
Returns a new instance of DefaultFormatter.
20 21 22 23 |
# File 'lib/kpm/formatter.rb', line 20 def initialize(label, input) @label = label @input = input end |
Instance Method Details
#label ⇒ Object
33 34 35 |
# File 'lib/kpm/formatter.rb', line 33 def label @label.to_s.upcase.gsub(/_/, ' ') end |
#size ⇒ Object
25 26 27 |
# File 'lib/kpm/formatter.rb', line 25 def size to_s.size end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/kpm/formatter.rb', line 29 def to_s @input.to_s end |