Method: Jig#split

Defined in:
lib/jig.rb

#split(*args) ⇒ Object

call-seq:

split(pattern=$;, [limit])

With no arguments, the jig is split at the gap positions into an array of strings. If arguments are provided, the jig is rendered to a string by #to_s and the result of String#split (with the arguments) is returned.



643
644
645
646
647
648
649
# File 'lib/jig.rb', line 643

def split(*args)
  if args.empty?
    contents.map { |c| c.join }
  else
    to_s.split(*args)
  end
end