Class: Betterp::Output
- Inherits:
-
Object
- Object
- Betterp::Output
- Defined in:
- lib/betterp/output.rb
Constant Summary collapse
- COLORS =
i[ red green yellow blue magenta cyan ].freeze
- EFFECTS =
[:bright, nil].freeze
Instance Method Summary collapse
- #format(args) ⇒ Object
-
#initialize(source) ⇒ Output
constructor
A new instance of Output.
Constructor Details
#initialize(source) ⇒ Output
Returns a new instance of Output.
14 15 16 |
# File 'lib/betterp/output.rb', line 14 def initialize(source) @source = source end |
Instance Method Details
#format(args) ⇒ Object
18 19 20 21 22 |
# File 'lib/betterp/output.rb', line 18 def format(args) args.map do |arg| colorize("#{@source}: ") + arg.inspect end end |