Class: Vanguard::Matcher::Unary::Attribute
- Inherits:
-
Vanguard::Matcher::Unary
- Object
- Vanguard::Matcher
- Vanguard::Matcher::Unary
- Vanguard::Matcher::Unary::Attribute
- Defined in:
- lib/vanguard/matcher/unary/attribute.rb
Overview
Matcher that matches on attribute of value
Instance Attribute Summary collapse
-
#attribute_name ⇒ Symbol
readonly
private
Return attribute name.
Attributes inherited from Vanguard::Matcher::Unary
Instance Method Summary collapse
-
#matches?(value) ⇒ true, false
private
Return operand result for length of value.
Instance Attribute Details
#attribute_name ⇒ Symbol (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
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
18 19 20 |
# File 'lib/vanguard/matcher/unary/attribute.rb', line 18 def matches?(value) operand_matches?(value.public_send(attribute_name)) end |