make a little more real

This commit is contained in:
Torsten Ruger 2014-09-16 16:05:38 +03:00
parent dd8e46fd1c
commit bbcfef3c43

View File

@ -6,6 +6,12 @@ class Parfait::Hash
@keys = Array.new() @keys = Array.new()
@values = Array.new() @values = Array.new()
end end
def values()
@values
end
def keys()
@keys
end
def empty? def empty?
@keys.empty? @keys.empty?
end end
@ -22,6 +28,9 @@ class Parfait::Hash
nil nil
end end
end end
def [](key)
get(key)
end
def key_index(key) def key_index(key)
len = @keys.length() len = @keys.length()
@ -47,5 +56,8 @@ class Parfait::Hash
end end
value value
end end
def []=(key,val)
set(key,val)
end
end end