Class: RCheck::Debugging::Debugger

Inherits:
Object
  • Object
show all
Defined in:
lib/rcheck/debugging.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*items) ⇒ Debugger

Returns a new instance of Debugger.



16
17
18
19
# File 'lib/rcheck/debugging.rb', line 16

def initialize(*items)
  @items      = items
  @backtrace  = Backtrace.parse caller(3)
end

Instance Attribute Details

#backtraceObject (readonly)

Returns the value of attribute backtrace.



14
15
16
# File 'lib/rcheck/debugging.rb', line 14

def backtrace
  @backtrace
end

#itemsObject (readonly)

Returns the value of attribute items.



14
15
16
# File 'lib/rcheck/debugging.rb', line 14

def items
  @items
end

Instance Method Details

#joinObject



21
22
23
24
25
# File 'lib/rcheck/debugging.rb', line 21

def join
  @items.map do |data|
    data.is_a?(String) ? data : data.inspect
  end.join(' ')
end

#locationObject



27
28
29
# File 'lib/rcheck/debugging.rb', line 27

def location
  @backtrace.first
end