Class: DelegatorArray

Inherits:
Array show all
Defined in:
lib/scruby/core_ext/delegator_array.rb

Instance Method Summary collapse

Methods inherited from Array

#collect_with_index, #encode_floats, #peel, #peel!, #to_array, #wrap_and_zip, #wrap_to, #wrap_to!

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



3
4
5
# File 'lib/scruby/core_ext/delegator_array.rb', line 3

def method_missing meth, *args, &block
  return self.map! { |item| item.send meth, *args, &block }
end

Instance Method Details

#to_aObject



8
# File 'lib/scruby/core_ext/delegator_array.rb', line 8

def to_a;  Array.new self; end

#to_daObject



7
# File 'lib/scruby/core_ext/delegator_array.rb', line 7

def to_da; self; end