Class: LogBuffer::LevelAndLog

Inherits:
Object
  • Object
show all
Defined in:
lib/debugtrace/log_buffer.rb

Overview

Contains a single line indentation level and log content.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nest_level, log) ⇒ LevelAndLog

Initializes this object.

Parameters:

  • nest_level (Integer)

    the nesting level

  • log (String)

    the log message



16
17
18
19
# File 'lib/debugtrace/log_buffer.rb', line 16

def initialize(nest_level, log)
  @nest_level = Common.check_type('nest_level', nest_level, Integer)
  @log = Common.check_type('log', log, String)
end

Instance Attribute Details

#logObject (readonly)

Returns the value of attribute log.



10
11
12
# File 'lib/debugtrace/log_buffer.rb', line 10

def log
  @log
end

#nest_levelObject (readonly)

Returns the value of attribute nest_level.



10
11
12
# File 'lib/debugtrace/log_buffer.rb', line 10

def nest_level
  @nest_level
end

Instance Method Details

#to_sString

Returns a string representation of this object.

Returns:

  • (String)

    a string representation of this object.



24
25
26
# File 'lib/debugtrace/log_buffer.rb', line 24

def to_s
  return "(LogBuffer.LevelAndLog){nest_level: #{@nest_level}, log: \"#{@log}\"}"
end