Class: OpenWFE::ProcessDefinition::Context
- Inherits:
-
Object
- Object
- OpenWFE::ProcessDefinition::Context
- Defined in:
- lib/openwfe/expressions/rprocdef.rb
Instance Attribute Summary collapse
-
#parent_expression ⇒ Object
Returns the value of attribute parent_expression.
-
#previous_parent_expressions ⇒ Object
readonly
Returns the value of attribute previous_parent_expressions.
-
#top_expressions ⇒ Object
Returns the value of attribute top_expressions.
Instance Method Summary collapse
- #discard ⇒ Object
- #discarded? ⇒ Boolean
-
#initialize ⇒ Context
constructor
A new instance of Context.
-
#pop_parent_expression ⇒ Object
Replaces the current parent expression with the one found on the top of the previous parent expression stack (pop).
-
#push_parent_expression(exp) ⇒ Object
puts the current parent expression on top of the ‘previous parent expressions’ stack, the current parent expression is replaced with the supplied parent expression.
-
#top_expression ⇒ Object
This method returns the top expression among the top expressions…
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
321 322 323 324 325 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 321 def initialize @parent_expression = nil @top_expressions = [] @previous_parent_expressions = [] end |
Instance Attribute Details
#parent_expression ⇒ Object
Returns the value of attribute parent_expression.
318 319 320 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 318 def parent_expression @parent_expression end |
#previous_parent_expressions ⇒ Object (readonly)
Returns the value of attribute previous_parent_expressions.
319 320 321 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 319 def previous_parent_expressions @previous_parent_expressions end |
#top_expressions ⇒ Object
Returns the value of attribute top_expressions.
318 319 320 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 318 def top_expressions @top_expressions end |
Instance Method Details
#discard ⇒ Object
327 328 329 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 327 def discard @discarded = true end |
#discarded? ⇒ Boolean
330 331 332 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 330 def discarded? (@discarded == true) end |
#pop_parent_expression ⇒ Object
Replaces the current parent expression with the one found on the top of the previous parent expression stack (pop).
351 352 353 354 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 351 def pop_parent_expression @parent_expression = @previous_parent_expressions.pop end |
#push_parent_expression(exp) ⇒ Object
puts the current parent expression on top of the ‘previous parent expressions’ stack, the current parent expression is replaced with the supplied parent expression.
339 340 341 342 343 344 345 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 339 def push_parent_expression (exp) @previous_parent_expressions.push(@parent_expression) \ if @parent_expression @parent_expression = exp end |
#top_expression ⇒ Object
This method returns the top expression among the top expressions…
360 361 362 363 364 365 366 367 368 |
# File 'lib/openwfe/expressions/rprocdef.rb', line 360 def top_expression return nil if @top_expressions.size > 1 exp = @top_expressions.first return exp if exp.first == "process-definition" nil end |