Sha256: ff5d52b350ff765876d598683937a905b101d7218f288ab347fc296e2515d9d9
Contents?: true
Size: 699 Bytes
Versions: 22
Compression:
Stored size: 699 Bytes
Contents
require 'delegate' require 'flipper/api/v1/decorators/gate' module Flipper module Api module V1 module Decorators 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 gate_values = feature.adapter.get(self) { 'key' => key, 'state' => state.to_s, 'gates' => gates.map do |gate| Decorators::Gate.new(gate, gate_values[gate.key]).as_json end, } end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems