Class: Compel::Validation::Result
- Inherits:
-
Object
- Object
- Compel::Validation::Result
- Defined in:
- lib/compel/validation/result.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, klass, error_message = nil) ⇒ Result
constructor
A new instance of Result.
- #valid? ⇒ Boolean
Constructor Details
#initialize(value, klass, error_message = nil) ⇒ Result
Returns a new instance of Result.
10 11 12 13 14 |
# File 'lib/compel/validation/result.rb', line 10 def initialize(value, klass, = nil) @value = value @klass = klass @error_message = end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
6 7 8 |
# File 'lib/compel/validation/result.rb', line 6 def @error_message end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
6 7 8 |
# File 'lib/compel/validation/result.rb', line 6 def klass @klass end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/compel/validation/result.rb', line 6 def value @value end |
Instance Method Details
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/compel/validation/result.rb', line 16 def valid? @error_message.nil? end |