1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Window < Struct.new(:command)
  def move(x,y)
    #move window to some place on desktop
  end

  def create
    #spawn window logic
  end
end

w = Window.new('gnome-terminal')

# In this moment I can't move window because it not exist yet, but I can register method call
# and after create run all registered metods
w.move(100,200)