Sha256: eb6003c8e21b58efbbe73ca10e21dfa4932ef688d598b9312a7dd4be97ae1140
Contents?: true
Size: 568 Bytes
Versions: 21
Compression:
Stored size: 568 Bytes
Contents
module Maid::RuleContainer include ::Maid::Tools attr_reader :rules # initialize_rules def initialize_rules(&rules) @rules ||= [] instance_exec(&rules) end # Register a rule with a description and instructions (lambda function). def rule(description, &instructions) @rules << ::Maid::Rule.new(description, instructions, @maid || self) end # Follow all registered rules. def follow_rules(*args) @rules.each do |rule| @logger.info("Rule: #{ rule.description }") unless @logger.nil? rule.follow(*args) end end end
Version data entries
21 entries across 21 versions & 1 rubygems