Class: LibSL::LogFile

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

Instance Method Summary collapse

Constructor Details

#initialize(dest = nil) ⇒ LogFile

Returns a new instance of LogFile.



4
5
6
# File 'lib/logging.rb', line 4

def initialize(dest=nil)
	@dest = dest
end

Instance Method Details

#<<(val) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/logging.rb', line 8

def << (val)
	case @dest
	when nil then return
	when String then
		File.new(@dest) {|f| f << val}
	when IO then @dest << val
	end
	self
end