Add #disabled? to DSL#94
Add #disabled? to DSL#94liamwhite wants to merge 1 commit intoflippercloud:masterfrom liamwhite:add-disabled-dsl
Conversation
|
Seems like the following would all work: if $flipper[:feature].enabled?
end
unless $flipper[:feature].enabled?
end
if $flipper[:feature].enabled?
else
endThe only place I can think where you can't use enabled would be an if elsif else statement, though I haven't done that yet with a feature (doesn't mean it hasn't been done or shouldn't be done). I think my main issue with adding this is that it could be confusing. Flipper is only about whether something is enabled or not, letting things through gates, not closing gates or keeping things out. Users of the gem have already been confused that they can't disable a feature for an individual thing. Adding disabled? could add to that as it provides a specific dsl method for checking disabled-ness, which flipper can't do. Thoughts? |
|
Hmm, I actually hadn't considered that Flipper isn't about boolean gates, but rather about custom logic gates that control the "enabled-ness" of a feature. I guess I'll close this and live with it. |
|
If i may, there definitely is use cases where that'd be awesome |
What it says on the tin.
DSL thing I thought should be added, since
$flipperis used as a global in an app I code for, and!$flipper[:feature].enabled?is rather ugly, and you can't always useunlessto negate stuff.