Reputation: 13842
Simply question but trying to see if there is an easier way:
if @integration.provider == "hello" || @integration.provider == "hi"
#block of code
end
Is there an easier way to just have "hello" || "hi"
?
Upvotes: 0
Views: 42
Reputation: 1402
Enumerable#include? will determine if a value is found in a given array.
if ["hello", "hi"].include? @integration.provider
Alternative syntax for strings:
if %w(hello hi).include? @integration.provider
Upvotes: 6