summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/controller.rb
diff options
context:
space:
mode:
authorRick Bradley <rick@rickbradley.com>2007-10-12 16:17:31 -0500
committerRick Bradley <rick@rickbradley.com>2007-10-12 16:17:31 -0500
commite90191af9300fda00cd29d609ac80daff00332cc (patch)
treecd211b9d28017ca246fe6253dcf6ff81462af0a6 /lib/puppet/network/controller.rb
parent10039b94c77d4543d3b256b0bbda855d57a17be1 (diff)
downloadpuppet-e90191af9300fda00cd29d609ac80daff00332cc.tar.gz
puppet-e90191af9300fda00cd29d609ac80daff00332cc.tar.xz
puppet-e90191af9300fda00cd29d609ac80daff00332cc.zip
more stuff for the interim commit
Diffstat (limited to 'lib/puppet/network/controller.rb')
-rw-r--r--lib/puppet/network/controller.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/puppet/network/controller.rb b/lib/puppet/network/controller.rb
new file mode 100644
index 000000000..7e4cca643
--- /dev/null
+++ b/lib/puppet/network/controller.rb
@@ -0,0 +1,30 @@
+class Puppet::Network::Controller
+ def initialize(args = {})
+ raise ArgumentError, ":indirection is required" unless args[:indirection]
+ @indirection = args[:indirection]
+ @klass = model_class_from_indirection_name(@indirection)
+ end
+
+ def find(args = {})
+ @klass.find(args)
+ end
+
+ def destroy(args = {})
+ @klass.destroy(args)
+ end
+
+ def search(args = {})
+ @klass.search(args)
+ end
+
+ def save(args = {})
+ instance = @klass.new(args)
+ instance.save
+ end
+
+ private
+
+ def model_class_from_indirection_name
+ Class.new # TODO : FIXME make this the indirection class
+ end
+end