Get a variable value, checking session parameters first, then local variables
(&self, name: &str)
| 132 | |
| 133 | /// Get a variable value, checking session parameters first, then local variables |
| 134 | pub fn get_variable(&self, name: &str) -> Option<Value> { |
| 135 | // First check session parameters |
| 136 | if let Some(session_arc) = self.get_session() { |
| 137 | if let Ok(user_session) = session_arc.read() { |
| 138 | if let Some(value) = user_session.parameters.get(name) { |
| 139 | return Some(value.clone()); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | // Check local variables |
| 144 | self.variables.get(name).cloned() |
| 145 | } |
| 146 | |
| 147 | /// Set a local variable with type information |
| 148 | pub fn set_variable(&mut self, name: String, value: Value) { |
no test coverage detected