Class: SWT::ObjectCommand

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

Instance Method Summary collapse

Methods inherited from TreeCommand

#accept, #stacktrace

Constructor Details

#initialize(parent, exp) ⇒ ObjectCommand

Returns a new instance of ObjectCommand.



166
167
168
169
# File 'lib/swt.rb', line 166

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

Instance Method Details

#invoke(stack) ⇒ Object



170
171
172
173
174
# File 'lib/swt.rb', line 170

def invoke(stack)
  lastobject=stack.last.getData("object")
  newobject=@exp.call(lastobject)
  stack.last.setData("object",newobject)
end