Class: RubimCode::Isolator
Overview
end Interrupts class
Class Attribute Summary collapse
-
.enabled ⇒ Object
Returns the value of attribute enabled.
-
.local_variables ⇒ Object
Returns the value of attribute local_variables.
-
.outside_binding ⇒ Object
Returns the value of attribute outside_binding.
Class Method Summary collapse
Class Attribute Details
.enabled ⇒ Object
Returns the value of attribute enabled.
247 248 249 |
# File 'lib/rubimc.rb', line 247 def enabled @enabled end |
.local_variables ⇒ Object
Returns the value of attribute local_variables.
246 247 248 |
# File 'lib/rubimc.rb', line 246 def local_variables @local_variables end |
.outside_binding ⇒ Object
Returns the value of attribute outside_binding.
245 246 247 |
# File 'lib/rubimc.rb', line 245 def outside_binding @outside_binding end |
Class Method Details
.permit!(var) ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/rubimc.rb', line 250 def self.permit!(var) return unless self.enabled return unless self.outside_binding return unless var.is_a? UserVariable return if var.type.in? ["fixed", "expression", "undefined", nil] return if var.type === /^tmp/ if !local_variables.include?(var.name) and outside_binding.local_variable_defined?(var.name.to_sym) RubimCode.perror "Undefined variable '#{var.name}'. To pass params in interruprts use instance variables: '@#{var.name}'" end end |
.run ⇒ Object
263 264 265 266 |
# File 'lib/rubimc.rb', line 263 def self.run self.local_variables = [] self.enabled = true end |
.stop ⇒ Object
268 269 270 |
# File 'lib/rubimc.rb', line 268 def self.stop self.enabled = false end |