Module: Gitlab::Client::Features
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/features.rb
Overview
Defines methods related to feature flags. docs.gitlab.com/ce/api/features.html
Instance Method Summary collapse
-
#delete_feature(name) ⇒ void
Delete a feature.
-
#features ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of all persisted features, with its gate values.
-
#set_feature(name, value, options = {}) ⇒ Gitlab::ObjectifiedHash
Set a features gate value.
Instance Method Details
#delete_feature(name) ⇒ void
This method returns an undefined value.
Delete a feature.
44 45 46 |
# File 'lib/gitlab/client/features.rb', line 44 def delete_feature(name) delete("/features/#{name}") end |
#features ⇒ Array<Gitlab::ObjectifiedHash>
Get a list of all persisted features, with its gate values.
13 14 15 |
# File 'lib/gitlab/client/features.rb', line 13 def features get('/features') end |
#set_feature(name, value, options = {}) ⇒ Gitlab::ObjectifiedHash
Set a features gate value. If a feature with the given name does not exist yet it will be created. The value can be a boolean, or an integer to indicate percentage of time.
32 33 34 35 |
# File 'lib/gitlab/client/features.rb', line 32 def set_feature(name, value, = {}) body = { value: value }.merge() post("/features/#{name}", body: body) end |