class Flipper::UI::Decorators::Gate
Attributes
Public: The value for the gate from the adapter.
Public Class Methods
Source
# File lib/flipper/ui/decorators/gate.rb, line 13 def initialize(gate, value = nil) super gate @value = value end
Calls superclass method
Public Instance Methods
Source
# File lib/flipper/ui/decorators/gate.rb, line 19 def as_json value_as_json = case data_type when :set value.to_a # json doesn't like sets else value end { 'key' => gate.key.to_s, 'name' => gate.name.to_s, 'value' => value_as_json, } end
Public: Returns instance as hash that is ready to be json dumped.