Sha256: f9b9ff114d274deea6b6d55beffbcb5bdbc75dc0fc465187e78f2960bd627380

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

module Flipper
  module Types
    class Group < Type
      attr_reader :name

      def initialize(name, &block)
        @name = name.to_sym
        @block = block
      end

      def match?(*args)
        @block.call(*args) == true
      end

      def enabled_value
        @name
      end

      alias_method :disabled_value, :enabled_value
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
flipper-0.2.1 lib/flipper/types/group.rb
flipper-0.2.0 lib/flipper/types/group.rb
flipper-0.1.1 lib/flipper/types/group.rb
flipper-0.1.0 lib/flipper/types/group.rb