Create name? method for booleans
What does this Merge Request do?
This MR allows boolean
settings to be accessed with an ?
at the end (predicate method) without needing a nested structure with an enabled: true|false
bool, e.g.
gdk.yml*
gdk:
some_setting1:
enabled: true
some_setting2: true
Before
config.some_setting1? # ✅ Worked
config.some_setting2? # ❌ Did not work - raised NoMethodError: undefined method `fetch' for true:TrueClass
With this MR, config.some_setting2?
now works
Related: gitlab#194156 (moved)
Merge Request checklist
-
Tests added for new functionality. If not, please raise Issue to follow-up. -
This change is backward compatible. If not, please include steps to communicate to our users. - [-] Documentation added/updated, if needed.
- [-]
gdk doctor
test added, if needed.
Edited by 🤖 GitLab Bot 🤖