Class: MiddlemanToc::Validator

Inherits:
Struct
  • Object
show all
Defined in:
lib/middleman_toc/validator.rb

Constant Summary collapse

INDENT =
'   '

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



4
5
6
# File 'lib/middleman_toc/validator.rb', line 4

def node
  @node
end

#pagesObject

Returns the value of attribute pages

Returns:

  • (Object)

    the current value of pages



4
5
6
# File 'lib/middleman_toc/validator.rb', line 4

def pages
  @pages
end

Instance Method Details

#validate!Object



7
8
9
10
11
# File 'lib/middleman_toc/validator.rb', line 7

def validate!
  hrefs.each do |href|
    missing_page(href) unless exists?(href)
  end
end