Sha256: f3cdcdcc965a916894085a70dd735f77d5472f2f83d80e7bc395bdc26aac614b

Contents?: true

Size: 556 Bytes

Versions: 10

Compression:

Stored size: 556 Bytes

Contents

module Simnos
  module Filterable
    def target?(topic_name)
      unless @options[:includes].empty?
        unless @options[:includes].include?(topic_name)
          Simnos.logger.debug("skip topic(with include-names option) #{topic_name}")
          return false
        end
      end

      unless @options[:excludes].empty?
        if @options[:excludes].any? { |regex| topic_name =~ regex }
          Simnos.logger.debug("skip topic(with exclude-names option) #{topic_name}")
          return false
        end
      end
      true
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
simnos-0.1.3.beta1 lib/simnos/filterable.rb
simnos-0.1.2 lib/simnos/filterable.rb
simnos-0.1.1 lib/simnos/filterable.rb
simnos-0.1.1.beta2 lib/simnos/filterable.rb
simnos-0.1.1.beta1 lib/simnos/filterable.rb
simnos-0.1.0 lib/simnos/filterable.rb
simnos-0.1.0.beta4 lib/simnos/filterable.rb
simnos-0.1.0.beta3 lib/simnos/filterable.rb
simnos-0.1.0.beta2 lib/simnos/filterable.rb
simnos-0.1.0.beta1 lib/simnos/filterable.rb