Class: MarkdownLint::RuleSet

Inherits:
Object
  • Object
show all
Defined in:
lib/mdl/ruleset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRuleSet

Returns a new instance of RuleSet.


39
40
41
# File 'lib/mdl/ruleset.rb', line 39

def initialize
  @rules = {}
end

Instance Attribute Details

#rulesObject (readonly)

Returns the value of attribute rules


37
38
39
# File 'lib/mdl/ruleset.rb', line 37

def rules
  @rules
end

Instance Method Details

#load(rules_file) ⇒ Object


47
48
49
50
# File 'lib/mdl/ruleset.rb', line 47

def load(rules_file)
  instance_eval(File.read(rules_file), rules_file)
  @rules
end

#load_defaultObject


52
53
54
# File 'lib/mdl/ruleset.rb', line 52

def load_default
  load(File.expand_path("../rules.rb", __FILE__))
end

#rule(id, description, &block) ⇒ Object


43
44
45
# File 'lib/mdl/ruleset.rb', line 43

def rule(id, description, &block)
  @rules[id] = Rule.new(id, description, block)
end