Sha256: b2e1befcdd9123380954fb42bdb596c0b475371540b6b7fd547fc4d938661b52
Contents?: true
Size: 691 Bytes
Versions: 8
Compression:
Stored size: 691 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.gate_values { 'key' => key, 'state' => state.to_s, 'gates' => gates.map { |gate| Decorators::Gate.new(gate, gate_values[gate.key]).as_json }, } end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems