Class: Vanguard::Matcher::Unary::Attribute

Inherits:
Vanguard::Matcher::Unary show all
Defined in:
lib/vanguard/matcher/unary/attribute.rb

Overview

Matcher that matches on attribute of value

Instance Attribute Summary collapse

Attributes inherited from Vanguard::Matcher::Unary

#operand

Instance Method Summary collapse

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)


28
29
30
# File 'lib/vanguard/matcher/unary/attribute.rb', line 28

def attribute_name
  @attribute_name
end

Instance Method Details

#matches?(value) ⇒ 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.

Return operand result for length of value

Returns:

  • (true)

    if operand returns false

  • (false)

    otherwise



18
19
20
# File 'lib/vanguard/matcher/unary/attribute.rb', line 18

def matches?(value)
  operand_matches?(value.public_send(attribute_name))
end