Class: Desmoservice::LogHandler

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination) ⇒ LogHandler

Returns a new instance of LogHandler.



6
7
8
# File 'lib/log_handler.rb', line 6

def initialize(destination)
  @destination = destination
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



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

def destination
  @destination
end

Instance Method Details

#add_log_message(log_message) ⇒ Object



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

def add_log_message(log_message)
  destination << log_message << "\n"
end

#new_lineObject



14
15
16
# File 'lib/log_handler.rb', line 14

def new_line()
  destination << "\n"
end