Class: Vinter::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/vinter/linter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



166
167
168
# File 'lib/vinter/linter.rb', line 166

def description
  @description
end

#idObject (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