Sha256: 46b8754d57099226491226aa0676f825bbd92531311f09012b4cc731034183cd

Contents?: true

Size: 485 Bytes

Versions: 1

Compression:

Stored size: 485 Bytes

Contents

module FeatureRich
  class GroupFeature < FeatureRich::FeatureHandler

    attr_accessor :sets

    def initialize(group_name, options = {})
      super
      @sets = []
    end

    def subset?(ary)
      (names & ary) == names
    end

    def names
      sets.map(&:name)
    end

    def feature(name, options = {})
      sets << FeatureRich::FeatureHandler.new(name.to_sym, options)
    end

    def configure(&block)
      instance_exec(&block)
      self
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feature-rich-0.2.0 lib/feature-rich/group_feature.rb