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
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #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
#[](key) ⇒ Object
31 32 33 |
# File 'lib/break/session.rb', line 31 def [](key) @metadata[key] end |
#[]=(key, value) ⇒ Object
35 36 37 |
# File 'lib/break/session.rb', line 35 def []=(key, value) @metadata[key] = value end |
#context ⇒ Object
22 23 24 |
# File 'lib/break/session.rb', line 22 def context contexts.last end |
#context!(*bindings, depth: 0) ⇒ Object
26 27 28 29 |
# File 'lib/break/session.rb', line 26 def context!(*bindings, depth: 0) contexts << Context.new(*bindings, depth: depth) enter end |
#enter ⇒ Object
14 15 16 |
# File 'lib/break/session.rb', line 14 def enter frontend.attach(self) end |
#leave ⇒ Object
18 19 20 |
# File 'lib/break/session.rb', line 18 def leave frontend.detach end |