Class: Rhino::Logger

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

Overview

A generic logger extracting output for testing. Can be accessed via the global.

Usage:

Rhino.logger.log("...")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream = STDOUT) ⇒ Logger

Returns a new instance of Logger.


12
13
14
# File 'lib/rhino/logger.rb', line 12

def initialize(stream = STDOUT)
  self.stream = stream
end

Instance Attribute Details

#streamObject

Returns the value of attribute stream


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

def stream
  @stream
end

Instance Method Details

#log(message) ⇒ Object


16
17
18
# File 'lib/rhino/logger.rb', line 16

def log(message)
  self.stream.puts message
end