Class: Vinter::Rule
- Inherits:
-
Object
- Object
- Vinter::Rule
- Defined in:
- lib/vinter/linter.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #apply(ast) ⇒ Object
-
#initialize(id, description, &block) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(id, description, &block) ⇒ Rule
Returns a new instance of Rule.
168 169 170 171 172 |
# File 'lib/vinter/linter.rb', line 168 def initialize(id, description, &block) @id = id @description = description @check = block end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
166 167 168 |
# File 'lib/vinter/linter.rb', line 166 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
166 167 168 |
# File 'lib/vinter/linter.rb', line 166 def id @id end |
Instance Method Details
#apply(ast) ⇒ Object
174 175 176 |
# File 'lib/vinter/linter.rb', line 174 def apply(ast) @check.call(ast) end |