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(raw, source) ⇒ Output
constructor
A new instance of Output.
Constructor Details
#initialize(raw, source) ⇒ Output
Returns a new instance of Output.
8 9 10 11 12 13 |
# File 'lib/betterp/output.rb', line 8 def initialize(raw, source) @raw = raw @source = source @color = color @effect = effect end |
Instance Method Details
#format(args) ⇒ Object
15 16 17 18 19 |
# File 'lib/betterp/output.rb', line 15 def format(args) args.map do |arg| colorize(prefix) + Paint[arg.inspect, :default, :bright] end end |