lib/flipper/api/v1/decorators/feature.rb in flipper-api-0.26.2 vs lib/flipper/api/v1/decorators/feature.rb in flipper-api-0.27.0

- old
+ new

@@ -8,19 +8,19 @@ class Feature < SimpleDelegator # Public: The feature being decorated. alias_method :feature, :__getobj__ # Public: Returns instance as hash that is ready to be json dumped. - def as_json(exclude_gates: false) + def as_json(exclude_gates: false, exclude_gate_names: false) result = { 'key' => key, 'state' => state.to_s, } unless exclude_gates gate_values = feature.adapter.get(self) result['gates'] = gates.map do |gate| - Decorators::Gate.new(gate, gate_values[gate.key]).as_json + Decorators::Gate.new(gate, gate_values[gate.key]).as_json(exclude_name: exclude_gate_names) end end result end