Class: PuppetDebugServer::DebugSession::SavedPuppetSessionState
- Inherits:
-
Object
- Object
- PuppetDebugServer::DebugSession::SavedPuppetSessionState
- Defined in:
- lib/puppet-debugserver/debug_session/puppet_session_state.rb
Overview
The state of Puppet when a debug session was paused, typically during a breakpoint or exception.
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
The exception thrown when the session was paused.
-
#pops_depth_level ⇒ Integer
readonly
The AST depth of the Pops Object that caused the session to pause.
-
#pops_target ⇒ Object
readonly
The Pops Object that caused the session to pause.
-
#puppet_stacktrace ⇒ Array<Object>
readonly
The puppet stacktrace, not ruby stacktrace, when the session was paused.
-
#scope ⇒ Puppet::Parser::Scope
readonly
The Pops Scope containing the Pops Object that caused the session to pause.
-
#variable_cache ⇒ Hash<Integer, Object>
readonly
A cache of variable references used to speed up Debug Server VariableReferences queries.
Instance Method Summary collapse
-
#clear! ⇒ Object
Clears the saved state.
-
#initialize ⇒ SavedPuppetSessionState
constructor
A new instance of SavedPuppetSessionState.
-
#update!(options = {}) ⇒ Object
Updates the saved session state.
Constructor Details
#initialize ⇒ SavedPuppetSessionState
Returns a new instance of SavedPuppetSessionState.
90 91 92 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 90 def initialize @variable_cache = {} end |
Instance Attribute Details
#exception ⇒ Object (readonly)
The exception thrown when the session was paused.
68 69 70 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 68 def exception @exception end |
#pops_depth_level ⇒ Integer (readonly)
The AST depth of the Pops Object that caused the session to pause.
84 85 86 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 84 def pops_depth_level @pops_depth_level end |
#pops_target ⇒ Object (readonly)
The Pops Object that caused the session to pause.
76 77 78 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 76 def pops_target @pops_target end |
#puppet_stacktrace ⇒ Array<Object> (readonly)
The puppet stacktrace, not ruby stacktrace, when the session was paused.
72 73 74 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 72 def puppet_stacktrace @puppet_stacktrace end |
#scope ⇒ Puppet::Parser::Scope (readonly)
The Pops Scope containing the Pops Object that caused the session to pause.
80 81 82 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 80 def scope @scope end |
#variable_cache ⇒ Hash<Integer, Object> (readonly)
A cache of variable references used to speed up Debug Server VariableReferences queries.
88 89 90 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 88 def variable_cache @variable_cache end |
Instance Method Details
#clear! ⇒ Object
Clears the saved state. Typically used a debug session is un-paused.
111 112 113 114 115 116 117 118 119 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 111 def clear! @exception = nil @puppet_stacktrace = nil @pops_target = nil @scope = nil @pops_depth_level = nil @variable_cache = {} self end |
#update!(options = {}) ⇒ Object
Updates the saved session state
101 102 103 104 105 106 107 108 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_state.rb', line 101 def update!( = {}) @exception = [:session_exception] unless [:session_exception].nil? @puppet_stacktrace = [:puppet_stacktrace] unless [:puppet_stacktrace].nil? @pops_target = [:pops_target] unless [:pops_target].nil? @scope = [:scope] unless [:scope].nil? @pops_depth_level = [:pops_depth_level] unless [:pops_depth_level].nil? self end |