- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
r321 r331 3 3 # = Enumerable#lazy implementation 4 4 # 5 # Enumerable#lazy returns an instance of Enumera ble::Lazy.5 # Enumerable#lazy returns an instance of Enumerator::Lazy. 6 6 # You can use it just like as normal Enumerable object, 7 7 # except these methods act as 'lazy': … … 17 17 # - zip 18 18 def lazy 19 Lazy.new(self)19 Enumerator::Lazy.new(self) 20 20 end 21 end 21 22 23 class Enumerator 22 24 # == Acknowledgements 23 25 # … … 40 42 } 41 43 end 44 45 def to_enum(meth=:each, *args, &block) 46 lz = Lazy.new(self, &block) 47 lz.obj = self 48 lz.meth = meth 49 lz.args = args 50 lz 51 end 52 alias enum_for to_enum 42 53 43 54 def map(&block)
Note:
See TracChangeset
for help on using the changeset viewer.