Class: Ra::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/ra/logger.rb

Overview

A logger used to make exe testing possible.

logger = Logger.new
logger.log("Greetings!")

Instance Method Summary collapse

Constructor Details

#initialize(stream: $stdout) ⇒ Logger

Returns a new instance of Logger.

Parameters:

  • stream (IO) (defaults to: $stdout)


10
11
12
# File 'lib/ra/logger.rb', line 10

def initialize(stream: $stdout)
  @stream = stream
end

Instance Method Details

#log(message = nil) ⇒ Object

Parameters:

  • message (String) (defaults to: nil)


15
16
17
# File 'lib/ra/logger.rb', line 15

def log(message = nil)
  @stream.puts message
end