Class: Betterp::Output

Inherits:
Object
  • Object
show all
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

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