Class: UdooNeoRest::Validate
- Inherits:
-
Object
- Object
- UdooNeoRest::Validate
- Defined in:
- lib/udooneorest/validators.rb
Overview
Base validation class. Override the valid? method
value : the value to be validated
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Validate
constructor
A new instance of Validate.
- #valid? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Validate
Returns a new instance of Validate.
13 14 15 16 17 |
# File 'lib/udooneorest/validators.rb', line 13 def initialize(value) @value = value @error_message = nil valid? end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
10 11 12 |
# File 'lib/udooneorest/validators.rb', line 10 def @error_message end |
#value ⇒ Object
Returns the value of attribute value.
11 12 13 |
# File 'lib/udooneorest/validators.rb', line 11 def value @value end |
Instance Method Details
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/udooneorest/validators.rb', line 19 def valid? raise 'SubclassShouldOverrideValid' end |