Class: Vanguard::Violation
- Inherits:
-
Object
- Object
- Vanguard::Violation
- Includes:
- Adamantium::Flat
- Defined in:
- lib/vanguard/violation.rb
Overview
Rule violation on resouce
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
private
Return object validated in this violation.
-
#rule ⇒ Vanguard::Rule
readonly
private
Rule which generated this Violation.
Instance Method Summary collapse
-
#attribute_name ⇒ Symbol
private
Name of the attribute which this Violation pertains to.
-
#info ⇒ Hash
private
Return violation info.
-
#type ⇒ Symbol
private
Return symbolic type of rule.
-
#values ⇒ Object
private
Return Violation values.
Instance Attribute Details
#resource ⇒ Object (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 object validated in this violation
14 15 16 |
# File 'lib/vanguard/violation.rb', line 14 def resource @resource end |
#rule ⇒ Vanguard::Rule (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.
Rule which generated this Violation
22 23 24 |
# File 'lib/vanguard/violation.rb', line 22 def rule @rule end |
Instance Method Details
#attribute_name ⇒ Symbol
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.
Name of the attribute which this Violation pertains to
31 32 33 |
# File 'lib/vanguard/violation.rb', line 31 def attribute_name rule.attribute_name end |
#info ⇒ Hash
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 violation info
51 52 53 |
# File 'lib/vanguard/violation.rb', line 51 def info rule.violation_info.merge(:value => @value) end |
#type ⇒ Symbol
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 symbolic type of rule
41 42 43 |
# File 'lib/vanguard/violation.rb', line 41 def type rule.type end |
#values ⇒ Object
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 Violation values
62 63 64 |
# File 'lib/vanguard/violation.rb', line 62 def values rule.violation_values end |