0
0
Fork 0

added [] and []= als aliases for find and add

This commit is contained in:
Gibheer 2011-06-22 07:46:28 +02:00
parent 665109f544
commit 98e208c874
2 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,7 @@ module Polecat
end # end of while
end
end
alias :[]= :add
def delete key
check_key key
@ -96,6 +97,7 @@ module Polecat
end
nil
end
alias :[] :find
def select node = @root, &block
if node.nil?

View File

@ -10,6 +10,7 @@ module Polecat
check_key key
@storage[key] = value
end
alias :[]= :add
def delete key
check_key key
@ -32,6 +33,7 @@ module Polecat
nil
end
end
alias :[] :find
def select &block
out = []