diff options
| author | Seba Gamboa <[email protected]> | 2015-10-20 12:48:31 -0300 |
|---|---|---|
| committer | Seba Gamboa <[email protected]> | 2015-10-20 12:48:31 -0300 |
| commit | 13b552538af9e9794398e4a4177ba1cea04cccca (patch) | |
| tree | a4c682a8750401876eebc7ede793a6ca1ad70fd5 /mrbgems/mruby-enumerator | |
| parent | f0e997422137e9fc92923a49465f009b2730e78d (diff) | |
| download | mruby-13b552538af9e9794398e4a4177ba1cea04cccca.tar.gz mruby-13b552538af9e9794398e4a4177ba1cea04cccca.zip | |
Remove obvious warnings from docs
Diffstat (limited to 'mrbgems/mruby-enumerator')
| -rw-r--r-- | mrbgems/mruby-enumerator/mrblib/enumerator.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/mrbgems/mruby-enumerator/mrblib/enumerator.rb b/mrbgems/mruby-enumerator/mrblib/enumerator.rb index d09ffaff8..e9300462a 100644 --- a/mrbgems/mruby-enumerator/mrblib/enumerator.rb +++ b/mrbgems/mruby-enumerator/mrblib/enumerator.rb @@ -581,27 +581,27 @@ module Kernel # # Here is such an example, with parameter passing and a sizing block: # - # module Enumerable - # # a generic method to repeat the values of any enumerable - # def repeat(n) - # raise ArgumentError, "#{n} is negative!" if n < 0 - # unless block_given? - # return to_enum(__method__, n) do # __method__ is :repeat here - # sz = size # Call size and multiply by n... - # sz * n if sz # but return nil if size itself is nil + # module Enumerable + # # a generic method to repeat the values of any enumerable + # def repeat(n) + # raise ArgumentError, "#{n} is negative!" if n < 0 + # unless block_given? + # return to_enum(__method__, n) do # __method__ is :repeat here + # sz = size # Call size and multiply by n... + # sz * n if sz # but return nil if size itself is nil + # end + # end + # each do |*val| + # n.times { yield *val } # end - # end - # each do |*val| - # n.times { yield *val } # end # end - # end # - # %i[hello world].repeat(2) { |w| puts w } - # # => Prints 'hello', 'hello', 'world', 'world' - # enum = (1..14).repeat(3) - # # => returns an Enumerator when called without a block - # enum.first(4) # => [1, 1, 1, 2] + # %i[hello world].repeat(2) { |w| puts w } + # # => Prints 'hello', 'hello', 'world', 'world' + # enum = (1..14).repeat(3) + # # => returns an Enumerator when called without a block + # enum.first(4) # => [1, 1, 1, 2] # def to_enum(meth=:each, *args) Enumerator.new self, meth, *args |
