Class: RolloutControl::FeaturesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rollout_control/features_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
# File 'app/controllers/rollout_control/features_controller.rb', line 5

def index
  features = rollout.features.map do |feature|
    rollout.get(feature).to_hash.merge(name: feature)
  end
  render json: features.to_json
end

#showObject



12
13
14
# File 'app/controllers/rollout_control/features_controller.rb', line 12

def show
  render json: rollout.get(feature).to_hash.merge(name: feature)
end

#updateObject



16
17
18
19
# File 'app/controllers/rollout_control/features_controller.rb', line 16

def update
  rollout.activate_percentage(feature, params[:percentage]) if params[:percentage]
  head 204
end