Method: Enumerable#each_group_element_by

Defined in:
lib/tb/ex_enumerable.rb

#each_group_element_by(representative, before_group, body, after_group) ⇒ Object

splits self by representative which is called with a element.

before_group is called before each group with the first element. after_group is called after each group with the last element. body is called for each element.



533
534
535
# File 'lib/tb/ex_enumerable.rb', line 533

def each_group_element_by(representative, before_group, body, after_group)
  detect_group_by(before_group, after_group, &representative).each(&body)
end