Class: MarkdownLint::Rule
- Inherits:
-
Object
- Object
- MarkdownLint::Rule
- Defined in:
- lib/mdl/ruleset.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #check(&block) ⇒ Object
-
#initialize(id, description, block) ⇒ Rule
constructor
A new instance of Rule.
- #params(p = nil) ⇒ Object
- #tags(*t) ⇒ Object
Constructor Details
#initialize(id, description, block) ⇒ Rule
Returns a new instance of Rule.
5 6 7 8 9 10 |
# File 'lib/mdl/ruleset.rb', line 5 def initialize(id, description, block) @id, @description = id, description @tags = [] @params = {} instance_eval &block end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/mdl/ruleset.rb', line 3 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/mdl/ruleset.rb', line 3 def id @id end |
Instance Method Details
#check(&block) ⇒ Object
13 14 15 16 |
# File 'lib/mdl/ruleset.rb', line 13 def check(&block) @check = block unless block.nil? @check end |
#params(p = nil) ⇒ Object
23 24 25 26 |
# File 'lib/mdl/ruleset.rb', line 23 def params(p = nil) @params.update(p) unless p.nil? @params end |
#tags(*t) ⇒ Object
18 19 20 21 |
# File 'lib/mdl/ruleset.rb', line 18 def (*t) @tags = t.flatten.map {|i| i.to_sym} unless t.empty? @tags end |