Class: Break::Context
- Inherits:
-
Object
- Object
- Break::Context
- Defined in:
- lib/break/context.rb
Instance Attribute Summary collapse
-
#bindings ⇒ Object
Returns the value of attribute bindings.
-
#depth ⇒ Object
Returns the value of attribute depth.
Instance Method Summary collapse
- #binding ⇒ Object
-
#initialize(*bindings, depth: 0) ⇒ Context
constructor
A new instance of Context.
- #inspect ⇒ Object
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
#bindings ⇒ Object
Returns the value of attribute bindings.
5 6 7 |
# File 'lib/break/context.rb', line 5 def bindings @bindings end |
#depth ⇒ Object
Returns the value of attribute depth.
6 7 8 |
# File 'lib/break/context.rb', line 6 def depth @depth end |
Instance Method Details
#binding ⇒ Object
13 14 15 |
# File 'lib/break/context.rb', line 13 def binding @bindings[@depth - 1] end |
#inspect ⇒ Object
17 18 19 |
# File 'lib/break/context.rb', line 17 def inspect "#{path}:#{lineno}" end |