Method: ExtCsv#split

Defined in:
lib/extcsv.rb

#split(*columns, &block) ⇒ Object

:call-seq: split.(:col0,…,:colN) {|obj| …} split.(:col0,…,:coln) -> [obj0,…,objM]

split is a multi-key-version of each_obj. the receiver is splitted into subobject, which have constant values in all given columns

eg. obj.split(:kv, :focus) {|little_obj| little_obj.kv == little_kv.uniq}

or

obj.split(:kv, :focus) = [obj_0,...,obj_N]



514
515
516
517
518
519
520
521
522
# File 'lib/extcsv.rb', line 514

def split(*columns, &block)
  retval = []
  deep_split(columns, retval)
  if block_given?
    retval.each(&block)
  else
    retval
  end
end