Sha256: a1e81dfb8ea06ed4d3dabff809080fd5168f68a2b5373486af60f366ce52a0bc

Contents?: true

Size: 445 Bytes

Versions: 3

Compression:

Stored size: 445 Bytes

Contents

module Flipper
  module Types
    class Group < Type

      def self.wrap(group_or_name)
        return group_or_name if group_or_name.is_a?(self)
        Flipper.group(group_or_name)
      end

      attr_reader :name

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

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

      def value
        @name
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-0.7.0.beta3 lib/flipper/types/group.rb
flipper-0.7.0.beta2 lib/flipper/types/group.rb
flipper-0.7.0.beta1 lib/flipper/types/group.rb