Class: Hometown::Trace

Inherits:
Object
  • Object
show all
Defined in:
lib/hometown/trace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(traced_class, backtrace) ⇒ Trace

Returns a new instance of Trace.



5
6
7
8
# File 'lib/hometown/trace.rb', line 5

def initialize(traced_class, backtrace)
  @traced_class = traced_class
  @backtrace    = backtrace
end

Instance Attribute Details

#backtraceObject (readonly)

Returns the value of attribute backtrace.



3
4
5
# File 'lib/hometown/trace.rb', line 3

def backtrace
  @backtrace
end

#traced_classObject (readonly)

Returns the value of attribute traced_class.



3
4
5
# File 'lib/hometown/trace.rb', line 3

def traced_class
  @traced_class
end

Instance Method Details

#eql?(b) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/hometown/trace.rb', line 10

def eql?(b)
  @traced_class == b.traced_class &&
    @backtrace  == b.backtrace
end

#hashObject



15
16
17
# File 'lib/hometown/trace.rb', line 15

def hash
  [@traced_class, @backtrace].hash
end