Class: Typ::Formatter
- Inherits:
-
Object
- Object
- Typ::Formatter
- Defined in:
- lib/typ/formatter.rb
Instance Method Summary collapse
-
#initialize(typ) ⇒ Formatter
constructor
A new instance of Formatter.
- #to_s ⇒ Object
Constructor Details
#initialize(typ) ⇒ Formatter
Returns a new instance of Formatter.
5 6 7 8 9 10 11 12 |
# File 'lib/typ/formatter.rb', line 5 def initialize typ name = typ.class.name @string = if typ.ok? Rainbow(name).green else Rainbow(name).red + "\n" + format_gates_of(typ) end end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/typ/formatter.rb', line 14 def to_s @string end |