* guest#running?
[strongswan.git] / src / dumm / ext / lib / dumm / guest.rb
1 =begin
2 Copyright (C) 2008 Tobias Brunner
3 Hochschule fuer Technik Rapperswil
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
14
15 $Id$
16 =end
17
18 module Dumm
19 class Guest
20 # accessor for guests
21 # e.g. Guest.sun instead of Guest["sun"]
22 def self.method_missing(id, *args)
23 unless guest? id
24 super(id, *args)
25 end
26 Guest[id]
27 end
28
29 # accessor for interfaces
30 # e.g. guest.eth0 instead of guest["eth0"]
31 def method_missing(id, *args)
32 unless iface? id
33 super(id, *args)
34 end
35 self[id]
36 end
37 end
38 end
39
40 # vim:sw=2 ts=2 et