Skip to content

Instantly share code, notes, and snippets.

@RoxasShadow
Created September 11, 2013 12:22
Show Gist options
  • Select an option

  • Save RoxasShadow/6522791 to your computer and use it in GitHub Desktop.

Select an option

Save RoxasShadow/6522791 to your computer and use it in GitHub Desktop.
class String
def contained_in?(ary)
ary.each { |elm|
return true if self.include? elm
}
false
end
end
puts 'ciao marco'.contained_in? [ 'ciao', 'we' ]
puts 'ciao marco'.contained_in? [ 'we' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment