Class: Detox::ValidityBroker
- Inherits:
-
Object
- Object
- Detox::ValidityBroker
- Defined in:
- lib/detox/validity_broker.rb
Defined Under Namespace
Classes: Errors
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#validatee ⇒ Object
Returns the value of attribute validatee.
Instance Method Summary collapse
-
#initialize ⇒ ValidityBroker
constructor
A new instance of ValidityBroker.
- #invalid? ⇒ Boolean
- #invaliditize ⇒ Object
- #read_attribute_for_validation(attribute) ⇒ Object
- #valid? ⇒ Boolean
- #validitize ⇒ Object
Constructor Details
#initialize ⇒ ValidityBroker
Returns a new instance of ValidityBroker.
7 8 9 10 |
# File 'lib/detox/validity_broker.rb', line 7 def initialize @validity = true @errors = Errors.new(self) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/detox/validity_broker.rb', line 4 def errors @errors end |
#validatee ⇒ Object
Returns the value of attribute validatee.
5 6 7 |
# File 'lib/detox/validity_broker.rb', line 5 def validatee @validatee end |
Instance Method Details
#invalid? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/detox/validity_broker.rb', line 18 def invalid? value = @validity validitize !value end |
#invaliditize ⇒ Object
28 29 30 |
# File 'lib/detox/validity_broker.rb', line 28 def invaliditize @validity = false end |
#read_attribute_for_validation(attribute) ⇒ Object
32 33 34 |
# File 'lib/detox/validity_broker.rb', line 32 def read_attribute_for_validation(attribute) validatee end |
#valid? ⇒ Boolean
12 13 14 15 16 |
# File 'lib/detox/validity_broker.rb', line 12 def valid? value = @validity validitize value end |
#validitize ⇒ Object
24 25 26 |
# File 'lib/detox/validity_broker.rb', line 24 def validitize @validity = true end |