Class: GitWakaTime::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/gitwakatime/log.rb

Overview

Pretty output, and ability to silence in testing

Instance Method Summary collapse

Constructor Details

#initialize(msg, color = nil) ⇒ Log

Returns a new instance of Log.



5
6
7
8
9
# File 'lib/gitwakatime/log.rb', line 5

def initialize(msg, color = nil)
  @color = color
  @msg = msg
  print_message
end

Instance Method Details



11
12
13
14
15
16
17
18
# File 'lib/gitwakatime/log.rb', line 11

def print_message
  return if ENV['waka_log'] == 'false'
  if @color.nil?
    puts @msg
  else
    puts @msg.send(@color)
  end
end