Class: BinData::Tracer
- Inherits:
-
Object
- Object
- BinData::Tracer
- Defined in:
- lib/bindata/trace.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(io) ⇒ Tracer
constructor
A new instance of Tracer.
- #trace(msg) ⇒ Object
- #trace_obj(obj_name, val) ⇒ Object
Constructor Details
#initialize(io) ⇒ Tracer
Returns a new instance of Tracer.
6 7 8 |
# File 'lib/bindata/trace.rb', line 6 def initialize(io) @trace_io = io end |
Instance Method Details
#trace(msg) ⇒ Object
10 11 12 |
# File 'lib/bindata/trace.rb', line 10 def trace(msg) @trace_io.puts(msg) end |
#trace_obj(obj_name, val) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/bindata/trace.rb', line 14 def trace_obj(obj_name, val) if val.length > 30 val = val.slice(0..30) + "..." end trace "#{obj_name} => #{val}" end |