Class: SWT::ConditionalCommand

Inherits:
ContainerTreeCommand show all
Defined in:
lib/swt.rb

Instance Method Summary collapse

Methods inherited from ContainerTreeCommand

#accept, #to_s

Methods inherited from TreeCommand

#accept, #stacktrace

Constructor Details

#initialize(parent, exp) ⇒ ConditionalCommand


199
200
201
202
# File 'lib/swt.rb', line 199

def initialize(parent,exp)
  super(parent)
  @exp=exp
end

Instance Method Details

#invoke(stack) ⇒ Object


203
204
205
206
# File 'lib/swt.rb', line 203

def invoke(stack)
  condition=@exp.call stack.last.getData("object")
  super if condition
end