Class: ConfigOMat::FileLogWriter

Inherits:
LogWriter show all
Defined in:
lib/config_o_mat/shared/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LogWriter

#call

Constructor Details

#initialize(file_path) ⇒ FileLogWriter

Returns a new instance of FileLogWriter.



45
46
47
# File 'lib/config_o_mat/shared/types.rb', line 45

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



43
44
45
# File 'lib/config_o_mat/shared/types.rb', line 43

def file_path
  @file_path
end

Instance Method Details

#writeObject



49
50
51
# File 'lib/config_o_mat/shared/types.rb', line 49

def write
  File.open(@file_path, 'a') { |f| f.write(yield) }
end