Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string-include_any.rb
Instance Method Summary collapse
Instance Method Details
#include_any?(*args) ⇒ Boolean
2 3 4 5 6 |
# File 'lib/string-include_any.rb', line 2 def include_any?(*args) raise ArgumentError, "Requires at least one argument" if args.length == 0 raise ArgumentError, "Must enter all String arguments" unless args.all? {|arg| arg.instance_of? String} args.any? {|arg| include? arg} end |