Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/toga/extensions.rb

Instance Method Summary collapse

Instance Method Details

#includes_prefix?(prefix) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
# File 'lib/toga/extensions.rb', line 22

def includes_prefix?(prefix)
  self.each_with_index do |str, i|
    next if !str.is_a? String
    return i if str.starts_with?(prefix)
  end
  false
end