Method: Array#drop_while

Defined in:
lib/ruby/jruby_hack.rb

#drop_while(&block) ⇒ Array

Drops the longest prefix of elements that satisfy the predicate.

Returns:



109
110
111
112
113
114
115
116
# File 'lib/ruby/jruby_hack.rb', line 109

def drop_while(&block)
  # This is in tail call form
  if not empty? and yield(head)
    tail.drop_while(&block)
  else
    self
  end
end