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
- #aliases(*a) ⇒ Object
- #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 11 |
# File 'lib/mdl/ruleset.rb', line 5 def initialize(id, description, block) @id, @description = id, description @aliases = [] @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
#aliases(*a) ⇒ Object
24 25 26 27 |
# File 'lib/mdl/ruleset.rb', line 24 def aliases(*a) @aliases.concat(a) @aliases end |
#check(&block) ⇒ Object
14 15 16 17 |
# File 'lib/mdl/ruleset.rb', line 14 def check(&block) @check = block unless block.nil? @check end |
#params(p = nil) ⇒ Object
29 30 31 32 |
# File 'lib/mdl/ruleset.rb', line 29 def params(p = nil) @params.update(p) unless p.nil? @params end |
#tags(*t) ⇒ Object
19 20 21 22 |
# File 'lib/mdl/ruleset.rb', line 19 def (*t) @tags = t.flatten.map {|i| i.to_sym} unless t.empty? @tags end |