Class: Marko::Markup::Validator

Inherits:
Validator show all
Defined in:
lib/marko/markup/validator.rb

Instance Method Summary collapse

Methods included from Pluggable

#plug

Constructor Details

#initializeValidator

Returns a new instance of Validator.



9
10
11
12
13
14
15
# File 'lib/marko/markup/validator.rb', line 9

def initialize
  @inspectors = []
  @inspectors << TheSameId.new
  @inspectors << LostParent.new
  @inspectors << LostIndex.new
  @inspectors << LostLink.new
end

Instance Method Details

#call(tree) ⇒ Object

see Marko::Validator#call



18
19
20
21
22
# File 'lib/marko/markup/validator.rb', line 18

def call(tree)
  [].tap{|errors|
    @inspectors.each{|spectr| errors.concat(spectr.(tree)) }
  }
end