Class: Break::Context

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*bindings, depth: 0) ⇒ Context

Returns a new instance of Context.



8
9
10
11
# File 'lib/break/context.rb', line 8

def initialize(*bindings, depth: 0)
  @bindings = bindings
  @depth = depth
end

Instance Attribute Details

#bindingsObject

Returns the value of attribute bindings.



5
6
7
# File 'lib/break/context.rb', line 5

def bindings
  @bindings
end

#depthObject

Returns the value of attribute depth.



6
7
8
# File 'lib/break/context.rb', line 6

def depth
  @depth
end

Instance Method Details

#bindingObject



13
14
15
# File 'lib/break/context.rb', line 13

def binding
  @bindings[@depth - 1]
end

#inspectObject



17
18
19
# File 'lib/break/context.rb', line 17

def inspect
  "#{path}:#{lineno}"
end