Add `exclude!` instance interface
I thought I pulled this in for 0.5.0, but apparently didn't.
This just adds a nicer way to include logic within the experiment block to exclude contexts.
experiment(:example, actor: current_user) do |e|
e.exclude! unless can?(current_user, :manage, project)
e.control { }
e.candidate { }
end
This isn't really very much different than wrapping the experiment within an if
, but it does keep our experiment logic wrapped nicely in the experiment block. I think on how we might be able to automate some cleanup tasks if we can follow some of these patterns?
Edited by Jeremy Jackson