Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/zenweb/extensions.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#deep_each(depth = 0, &b) ⇒ Object
:nodoc:.
Instance Method Details
#deep_each(depth = 0, &b) ⇒ Object
:nodoc:
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/zenweb/extensions.rb', line 43 def deep_each(depth = 0, &b) # :nodoc: return self.to_enum(:deep_each) unless b each do |x| case x when Array then x.deep_each(depth + 1, &b) else # yield (depth-1)/2, x yield depth, x end end end |