module Yema module Registry class Rule include Enumerable attr_reader :rules def initialize @rules = Set.new end def add(rule) @rules << rule if rule end def merge(rule_set) @rules.merge(rule_set) end def each return enum_for :each unless block_given? @rules.each{|rule| yield rule} end end end end