class Flipper::Api::V1::Actions::Feature

Public Instance Methods

delete() click to toggle source
# File lib/flipper/api/v1/actions/feature.rb, line 19
def delete
  flipper.remove(feature_name)
  json_response({}, 204)
end
get() click to toggle source
# File lib/flipper/api/v1/actions/feature.rb, line 13
def get
  return json_error_response(:feature_not_found) unless feature_exists?(feature_name)
  feature = Decorators::Feature.new(flipper[feature_name])
  json_response(feature.as_json)
end

Private Instance Methods

feature_exists?(feature_name) click to toggle source
# File lib/flipper/api/v1/actions/feature.rb, line 26
def feature_exists?(feature_name)
  flipper.features.map(&:key).include?(feature_name)
end