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

Inherits:
Vanguard::Rule::Nullary show all
Defined in:
lib/vanguard/rule/nullary/attribute.rb,
lib/vanguard/rule/nullary/attribute/format.rb,
lib/vanguard/rule/nullary/attribute/length.rb,
lib/vanguard/rule/nullary/attribute/absence.rb,
lib/vanguard/rule/nullary/attribute/presence.rb,
lib/vanguard/rule/nullary/attribute/inclusion.rb,
lib/vanguard/rule/nullary/attribute/predicate.rb,
lib/vanguard/rule/nullary/attribute/primitive.rb

Direct Known Subclasses

Absence, Format, Inclusion, Length, Predicate, Presence, Primitive

Defined Under Namespace

Classes: Absence, Evaluator, Format, Inclusion, Length, Predicate, Presence, Primitive

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Vanguard::Rule::Nullary

builder, #type

Methods inherited from Vanguard::Rule

#evaluate, #evaluator, #violations

Constructor Details

#initialize(attribute_name, matcher) ⇒ undefined

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.

Initialize object

Parameters:

  • attribute_name (Symbol)

    the name of the attribute to validate.



34
35
36
# File 'lib/vanguard/rule/nullary/attribute.rb', line 34

def initialize(attribute_name, matcher)
  @attribute_name, @matcher = attribute_name, matcher
end

Instance Attribute Details

#attribute_nameSymbol (readonly)

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 attribute name

Returns:

  • (Symbol)


15
16
17
# File 'lib/vanguard/rule/nullary/attribute.rb', line 15

def attribute_name
  @attribute_name
end

#matcherMatcher (readonly)

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:



23
24
25
# File 'lib/vanguard/rule/nullary/attribute.rb', line 23

def matcher
  @matcher
end