Class: Formalist::Form::ValidatedResult
- Inherits:
-
Object
- Object
- Formalist::Form::ValidatedResult
- Extended by:
- Forwardable
- Defined in:
- lib/formalist/form/validated_result.rb
Instance Attribute Summary collapse
- #result ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(result) ⇒ ValidatedResult
constructor
A new instance of ValidatedResult.
- #messages ⇒ Object
- #success? ⇒ Boolean
- #to_ast ⇒ Object
Constructor Details
#initialize(result) ⇒ ValidatedResult
Returns a new instance of ValidatedResult.
18 19 20 |
# File 'lib/formalist/form/validated_result.rb', line 18 def initialize(result) @result = result end |
Instance Attribute Details
#result ⇒ 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.
16 17 18 |
# File 'lib/formalist/form/validated_result.rb', line 16 def result @result end |
Instance Method Details
#messages ⇒ Object
26 27 28 |
# File 'lib/formalist/form/validated_result.rb', line 26 def validation. end |
#success? ⇒ Boolean
22 23 24 |
# File 'lib/formalist/form/validated_result.rb', line 22 def success? validation.success? end |
#to_ast ⇒ Object
30 31 32 |
# File 'lib/formalist/form/validated_result.rb', line 30 def to_ast elements.map { |el| el.(output, schema.rules.map(&:to_ary), ).to_ast } end |