Class: ConfigOMat::FileLogWriter
- Defined in:
- lib/config_o_mat/shared/types.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ FileLogWriter
constructor
A new instance of FileLogWriter.
- #write ⇒ Object
Methods inherited from LogWriter
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_path ⇒ Object (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
#write ⇒ Object
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 |