Method: LazyArray#method_missing
- Defined in:
- lib/extlib/lazy_array.rb
#method_missing(method, *args, &block) ⇒ Object (private)
delegate any not-explicitly-handled methods to @array, if possible. this is handy for handling methods mixed-into Array like group_by
422 423 424 425 426 427 428 429 430 |
# File 'lib/extlib/lazy_array.rb', line 422 def method_missing(method, *args, &block) if @array.respond_to?(method) lazy_load results = @array.send(method, *args, &block) results.equal?(@array) ? self : results else super end end |