summaryrefslogtreecommitdiffhomepage
path: root/mrblib/range.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-05-06 06:29:39 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-05-06 06:29:39 -0700
commit4edfe3bc379ffd42ea56108582316a98bf142101 (patch)
treefe022811a83ef98bfecfbf4250e42a7cae034329 /mrblib/range.rb
parent4f9a7e90adf0bdd77e7971d5066834c68eac33b0 (diff)
parent1906d6eb33ea7e9643a7f506b83c13bcccf133dd (diff)
downloadmruby-4edfe3bc379ffd42ea56108582316a98bf142101.tar.gz
mruby-4edfe3bc379ffd42ea56108582316a98bf142101.zip
Merge pull request #101 from bovi/master
Add documentation for Hash, Kernel, Numeric, Array and Range
Diffstat (limited to 'mrblib/range.rb')
-rw-r--r--mrblib/range.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/mrblib/range.rb b/mrblib/range.rb
index 79bc40ecd..44be0305b 100644
--- a/mrblib/range.rb
+++ b/mrblib/range.rb
@@ -1,8 +1,14 @@
+##
+# Range
#
-# Range
-#
+# ISO 15.2.14
class Range
- # 15.2.14.4.4
+
+ ##
+ # Calls the given block for each element of +self+
+ # and pass the respective element.
+ #
+ # ISO 15.2.14.4.4
def each(&block)
val = self.first
unless val.respond_to? :succ
@@ -23,7 +29,10 @@ class Range
end
end
-# include modules
+##
+# Range is enumerable
+#
+# ISO 15.2.14.3
module Enumerable; end
class Range
include Enumerable