Class: Amrita2::Extention::ExpandByMember::Expander

Inherits:
Expander::Node
  • Object
show all
Defined in:
lib/amrita2/core.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#expand(data, i = 0) ⇒ Object



1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/amrita2/core.rb', line 1659

def expand(data, i=0)
  if data.kind_of?(Enumerable)
    data.each_with_index do |d, i|
      expand(d, i)
    end
  else
    @method.call(i) do 
      each do |c|
        dd = data.send(c.name)
        c.expand(dd)
      end
    end
  end
end