Class: Flipper::Api::V1::Decorators::Feature
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Flipper::Api::V1::Decorators::Feature
- Defined in:
- lib/flipper/api/v1/decorators/feature.rb
Instance Method Summary collapse
-
#as_json ⇒ Object
Public: Returns instance as hash that is ready to be json dumped.
Instance Method Details
#as_json ⇒ Object
Public: Returns instance as hash that is ready to be json dumped.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flipper/api/v1/decorators/feature.rb', line 14 def as_json gate_values = feature.gate_values { 'key' => key, 'state' => state.to_s, 'gates' => gates.map { |gate| Decorators::Gate.new(gate, gate_values[gate.key]).as_json }, } end |