Module: LogAndPrint
- Included in:
- BinaryMatrix
- Defined in:
- lib/log_and_print.rb
Overview
Utilities that support logging and printing
Copyright GPL 3 – Joseph J. Simpson – 2014 11-27-2014 code to create log file
Instance Method Summary collapse
Instance Method Details
#square_print_with_comment(comment, matrix = bm) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/log_and_print.rb', line 8 def square_print_with_comment(comment, matrix = bm) puts ' ' puts comment puts matrix.to_a.map(&:inspect) puts ' ' end |
#write_log(log_name, data) ⇒ Object
15 16 17 |
# File 'lib/log_and_print.rb', line 15 def write_log(log_name, data) File.open(log_name, 'a+') { |f| f.write(data) } end |