lib/key_tree.rb in key_tree-0.5.0 vs lib/key_tree.rb in key_tree-0.5.1
- old
+ new
@@ -13,13 +13,15 @@
# -> 2
#
module KeyTree
def self.[](contents = {})
case contents
+ when Tree, Forest
+ contents
when Hash
- KeyTree::Tree[contents]
+ Tree[contents]
when Array
- KeyTree::Forest[*contents]
+ Forest[*contents]
else
raise ArgumentError, "can't load #{contents.class} into a KeyTree"
end
end