Sha256: 4e54efbeb4f991c73ed3b76e8c417413dca09c6f8d5af89899ca3ec132d00fa9

Contents?: true

Size: 303 Bytes

Versions: 7

Compression:

Stored size: 303 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 value
        @name
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flipper-0.6.3 lib/flipper/types/group.rb
flipper-0.6.2 lib/flipper/types/group.rb
flipper-0.6.1 lib/flipper/types/group.rb
flipper-0.6.0 lib/flipper/types/group.rb
flipper-0.5.0 lib/flipper/types/group.rb
flipper-0.4.0 lib/flipper/types/group.rb
flipper-0.3.0 lib/flipper/types/group.rb