summaryrefslogtreecommitdiffstats
path: root/lib/blink/client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/blink/client.rb')
-rw-r--r--lib/blink/client.rb15
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