Module: MeasureMethod::Logger
Instance Method Summary collapse
Instance Method Details
#log(data) ⇒ Object
5 6 7 |
# File 'lib/measure_method/logger.rb', line 5 def log(data) puts(stringify(data)) end |
#puts(str) ⇒ Object
19 20 21 |
# File 'lib/measure_method/logger.rb', line 19 def puts(str) $stdout.puts(str) end |
#stringify(data) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/measure_method/logger.rb', line 9 def stringify(data) data.map do |k,v| if v.to_s =~ /[^0-9A-Z._-]/i [k, '=', '"', v, '"'].join else "#{k}=#{v}" end end.join(' ') end |