Sha256: 676b7866a7eb05b2fe2aa1fc74aade3538d11b489d2515b75af66dcb2ad47bd8

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

module RolloutUi
  class Wrapper
    class NoRolloutInstance < StandardError; end

    attr_reader :rollout

    def initialize(rollout = nil)
      @rollout = rollout || RolloutUi.rollout
      raise NoRolloutInstance unless @rollout
    end

    def groups
      rollout.instance_variable_get("@groups").keys
    end

    def add_feature(feature)
      redis.sadd(:features, feature)
    end

    def features
      redis.smembers(:features)
    end

    def redis
      rollout.instance_variable_get("@redis")
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rollout_ui-0.2.1 lib/rollout_ui/wrapper.rb
rollout_ui-0.2.0 lib/rollout_ui/wrapper.rb
bitlove-rollout_ui-0.1.0 lib/rollout_ui/wrapper.rb
rollout_ui-0.1.0 lib/rollout_ui/wrapper.rb