summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-enum-lazy
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-10-22 07:10:16 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-10-22 07:10:16 +0900
commit727f2485c9028cbd5eb4085e965bcaada6fb53f6 (patch)
treeb6876bcd35017746de47dc5f3949fcb72ea37c16 /mrbgems/mruby-enum-lazy
parente5fbf9dfa2bbbe5ecbf6cc25ff5d35e7da7f00e3 (diff)
parentd4238494eb7cd36c510c87ace6c31aeb1d0f1d6b (diff)
downloadmruby-727f2485c9028cbd5eb4085e965bcaada6fb53f6.tar.gz
mruby-727f2485c9028cbd5eb4085e965bcaada6fb53f6.zip
Merge pull request #2999 from sagmor/better-docs
More Docs
Diffstat (limited to 'mrbgems/mruby-enum-lazy')
-rw-r--r--mrbgems/mruby-enum-lazy/mrblib/lazy.rb43
1 files changed, 21 insertions, 22 deletions
diff --git a/mrbgems/mruby-enum-lazy/mrblib/lazy.rb b/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
index 2ffeb1808..8ce363c6d 100644
--- a/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
+++ b/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
@@ -1,30 +1,29 @@
-# = Enumerable#lazy implementation
-#
-# Enumerable#lazy returns an instance of Enumerable::Lazy.
-# You can use it just like as normal Enumerable object,
-# except these methods act as 'lazy':
-#
-# - map collect
-# - select find_all
-# - reject
-# - grep
-# - drop
-# - drop_while
-# - take_while
-# - flat_map collect_concat
-# - zip
-#
-# == Acknowledgements
-#
-# Based on https://github.com/yhara/enumerable-lazy
-# Inspired by https://github.com/antimon2/enumerable_lz
-# http://jp.rubyist.net/magazine/?0034-Enumerable_lz (ja)
-
module Enumerable
+
+ # = Enumerable#lazy implementation
+ #
+ # Enumerable#lazy returns an instance of Enumerable::Lazy.
+ # You can use it just like as normal Enumerable object,
+ # except these methods act as 'lazy':
+ #
+ # - map collect
+ # - select find_all
+ # - reject
+ # - grep
+ # - drop
+ # - drop_while
+ # - take_while
+ # - flat_map collect_concat
+ # - zip
def lazy
Lazy.new(self)
end
+ # == Acknowledgements
+ #
+ # Based on https://github.com/yhara/enumerable-lazy
+ # Inspired by https://github.com/antimon2/enumerable_lz
+ # http://jp.rubyist.net/magazine/?0034-Enumerable_lz (ja)
class Lazy < Enumerator
def initialize(obj, &block)
super(){|yielder|