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.
16 17 18 19 |
# File 'lib/kpm/formatter.rb', line 16 def initialize(label, input) @label = label @input = input end |
Instance Method Details
#label ⇒ Object
29 30 31 |
# File 'lib/kpm/formatter.rb', line 29 def label @label.to_s.upcase.gsub(/_/, ' ') end |
#size ⇒ Object
21 22 23 |
# File 'lib/kpm/formatter.rb', line 21 def size to_s.size end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/kpm/formatter.rb', line 25 def to_s @input.to_s end |