class Redactor::DSL

Attributes

redactor[R]

Public Class Methods

new(redactor) click to toggle source
# File lib/redactor/dsl.rb, line 5
def initialize(redactor)
  @redactor = redactor
end
run(redactor, block) click to toggle source
# File lib/redactor/dsl.rb, line 14
def self.run(redactor, block)
  new(redactor).instance_eval(&block)
end

Public Instance Methods

rule(reason, regex = nil, &block) click to toggle source
# File lib/redactor/dsl.rb, line 9
def rule(reason, regex = nil, &block)
  rule = Rule.new(reason, regex, &block)
  redactor.register_rule(rule)
end