Class: Break::Session
- Inherits:
-
Object
- Object
- Break::Session
- Defined in:
- lib/break/session.rb
Instance Attribute Summary collapse
-
#contexts ⇒ Object
readonly
Returns the value of attribute contexts.
-
#frontend ⇒ Object
readonly
Returns the value of attribute frontend.
Instance Method Summary collapse
- #context ⇒ Object
- #context!(*bindings, depth: 0) ⇒ Object
- #enter ⇒ Object
-
#initialize(binding, frontend:) ⇒ Session
constructor
A new instance of Session.
- #leave ⇒ Object
Constructor Details
Instance Attribute Details
#contexts ⇒ Object (readonly)
Returns the value of attribute contexts.
5 6 7 |
# File 'lib/break/session.rb', line 5 def contexts @contexts end |
#frontend ⇒ Object (readonly)
Returns the value of attribute frontend.
6 7 8 |
# File 'lib/break/session.rb', line 6 def frontend @frontend end |
Instance Method Details
#context ⇒ Object
21 22 23 |
# File 'lib/break/session.rb', line 21 def context contexts.last end |
#context!(*bindings, depth: 0) ⇒ Object
25 26 27 28 |
# File 'lib/break/session.rb', line 25 def context!(*bindings, depth: 0) contexts << Context.new(*bindings, depth: depth) enter end |
#enter ⇒ Object
13 14 15 |
# File 'lib/break/session.rb', line 13 def enter frontend.attach(self) end |
#leave ⇒ Object
17 18 19 |
# File 'lib/break/session.rb', line 17 def leave frontend.detach end |