lib/glue/flexob.rb in glue-0.18.1 vs lib/glue/flexob.rb in glue-0.19.0
- old
+ new
@@ -1,9 +1,5 @@
-# * George Moschovitis <gm@navel.gr>
-# (c) 2004-2005 Navel, all rights reserved.
-# $Id: flexob.rb 1 2005-04-11 11:04:30Z gmosx $
-
require 'ostruct'
# A flexible Object.
# Temporarily implemented as a simple OpenStruct.
@@ -13,7 +9,21 @@
hash.each do |k, v|
send("#{k}=", v)
end
end
alias_method :set, :update
+
+ def []=(key, val)
+ @table[key.to_sym] = val
+ end
+ def [](key)
+ @table[key.to_sym]
+ end
+
+ def each(&block)
+ @table.each(&block)
+ end
+
end
+
+# * George Moschovitis <gm@navel.gr>