Method: Vpim.outer_inner
- Defined in:
- lib/vpim/rfc2425.rb
.outer_inner(fields) ⇒ Object
Split an array into an array of all the fields at the outer level, and an array of all the inner arrays of fields. Return the array [outer, inner].
351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/vpim/rfc2425.rb', line 351 def Vpim.outer_inner(fields) #:nodoc: # TODO - use Enumerable#partition # seperate into the outer-level fields, and the arrays of component # fields outer = [] inner = [] fields.each do |line| case line when Array; inner << line else; outer << line end end return outer, inner end |