Class: Vanguard::Rule::Nullary::Attribute::Evaluator

Inherits:
Evaluator
  • Object
show all
Defined in:
lib/vanguard/rule/nullary/attribute.rb

Overview

Default evaluator

Direct Known Subclasses

Length::Evaluator

Instance Attribute Summary

Attributes inherited from Evaluator

#resource, #rule

Instance Method Summary collapse

Methods inherited from Evaluator

#initialize, #value, #violation, #violations

Constructor Details

This class inherits a constructor from Vanguard::Evaluator

Instance Method Details

#matcherMatcher

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return matcher

Returns:



61
62
63
# File 'lib/vanguard/rule/nullary/attribute.rb', line 61

def matcher
  rule.matcher
end

#valid?true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if value is valid

Returns:

  • (true)

    if value is matched by matcher

  • (false)

    otherwise



50
51
52
# File 'lib/vanguard/rule/nullary/attribute.rb', line 50

def valid?
  matcher.matches?(value)
end