Skip to content
This repository
Browse code

fixed Set#[]

  • Loading branch information...
commit 25d61df8604a758fcd216ee9894ddbdd37ac8ece 1 parent e3847c8
Christopher Bertels authored January 13, 2012

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. 9  lib/set.fy
9  lib/set.fy
@@ -95,7 +95,7 @@ class Set {
95 95
     @value Value to be checked for if included in @self.
96 96
     @return @true if @value in @self, @false otherwise.
97 97
 
98  
-    Indicates, if the Set includes a given value.
  98
+    Indicates, if the Set includes @value.
99 99
     """
100 100
 
101 101
     @hash includes?: value
@@ -103,10 +103,13 @@ class Set {
103 103
 
104 104
   def [value] {
105 105
     """
106  
-    Same as @Set#includes?:@
  106
+    @value Value to be checked for if included in @self.
  107
+    @return @true if @value is in @self, @nil otherwise.
  108
+
  109
+    Indicates, if the Set includes @value.
107 110
     """
108 111
 
109  
-    includes: value
  112
+    @hash[value]
110 113
   }
111 114
 
112 115
   def each: block {

0 notes on commit 25d61df

Please sign in to comment.
Something went wrong with that request. Please try again.