diff options
author | Luke Kanies <luke@madstop.com> | 2005-04-14 22:01:15 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-04-14 22:01:15 +0000 |
commit | 13f16b6690224758706e1c68d1da577a13df8be5 (patch) | |
tree | 428a1bc778b74363a130a5627ad2d5fae2e1e16d /lib/blink/client.rb | |
parent | 6140bee579c92cb89fc91ff8514a7796202a28fb (diff) | |
download | puppet-13f16b6690224758706e1c68d1da577a13df8be5.tar.gz puppet-13f16b6690224758706e1c68d1da577a13df8be5.tar.xz puppet-13f16b6690224758706e1c68d1da577a13df8be5.zip |
the client is now successfully creating objects from the hashes passed by the server
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@162 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/blink/client.rb')
-rw-r--r-- | lib/blink/client.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/blink/client.rb b/lib/blink/client.rb index 79c49f367..670aae4ad 100644 --- a/lib/blink/client.rb +++ b/lib/blink/client.rb @@ -6,6 +6,7 @@ require 'blink' require 'blink/function' +require 'blink/types' module Blink class ClientError < RuntimeError; end @@ -23,8 +24,22 @@ module Blink end def objects=(list) + Blink::Types.buildtypehash # refresh the list of available types + + objects = [] list.each { |object| # create a Blink object from the list... + if type = Blink::Types.type(object.type) + namevar = type.namevar + Blink.notice("%s namevar is %s" % [type.name,namevar]) + if namevar != :name + object[namevar] = object[:name] + object.delete(:name) + end + obj = type.new(object) + else + raise "Could not find object type %s" % object.type + end } end end |