Module: Rubeus::Extensions::Javax::Swing::Timer::ClassMethods

Defined in:
lib/rubeus/extensions/javax/swing/timer.rb

Instance Method Summary collapse

Instance Method Details

#new_with_rubeus(interval, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rubeus/extensions/javax/swing/timer.rb', line 12

def new_with_rubeus(interval, &block)
  # Create ActionListener implement class
  mod = Module.new do
    define_method("actionPerformed", &block)
  end

  obj = Object.new
  obj.extend(mod)

  # Use original constructor
  new_without_rubeus(interval, obj)
end