geekq / workflow

Ruby finite-state-machine-inspired API for modeling workflow
MIT License
1.74k stars 207 forks source link

Add State#in? #199

Closed svoop closed 5 years ago

svoop commented 7 years ago

A little convenience method to do the following:

article.current_state.in? %i(new awaiting_review)
# instead of
%i(new awaiting_review).include? article.current_state.to_sym

Shouldn't break anything, but allows to write more expressive conditions.