Class: RubyBreaker::ObjectPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/rubybreaker/debug/context.rb

Overview

This class represents a position with respect to an object and the name of a method being invoked.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj, meth_name) ⇒ ObjectPosition

Returns a new instance of ObjectPosition.



61
62
63
64
# File 'lib/rubybreaker/debug/context.rb', line 61

def initialize(obj, meth_name)
  @obj = obj
  @meth_name = meth_name
end

Instance Attribute Details

#meth_nameObject

Returns the value of attribute meth_name.



59
60
61
# File 'lib/rubybreaker/debug/context.rb', line 59

def meth_name
  @meth_name
end

#objObject

Returns the value of attribute obj.



58
59
60
# File 'lib/rubybreaker/debug/context.rb', line 58

def obj
  @obj
end

Instance Method Details

#to_sObject



66
67
68
69
# File 'lib/rubybreaker/debug/context.rb', line 66

def to_s()
  m_delim = @obj.kind_of?(Module) ? "." : "#"
  return "> #{@obj.class}#{m_delim}#{@meth_name}"
end