Class: KPM::Formatter::DefaultFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/kpm/formatter.rb

Overview

Used for normal types where to_s is enough

Instance Method Summary collapse

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

#labelObject



33
34
35
# File 'lib/kpm/formatter.rb', line 33

def label
  @label.to_s.upcase.gsub(/_/, ' ')
end

#sizeObject



25
26
27
# File 'lib/kpm/formatter.rb', line 25

def size
  to_s.size
end

#to_sObject



29
30
31
# File 'lib/kpm/formatter.rb', line 29

def to_s
  @input.to_s
end