Module: AxiomusApi::Validated
- Included in:
- Base
- Defined in:
- lib/axiomus_api/validated.rb
Instance Attribute Summary collapse
-
#validation_errors ⇒ Object
readonly
Returns the value of attribute validation_errors.
Instance Method Summary collapse
Instance Attribute Details
#validation_errors ⇒ Object (readonly)
Returns the value of attribute validation_errors.
2 3 4 |
# File 'lib/axiomus_api/validated.rb', line 2 def validation_errors @validation_errors end |
Instance Method Details
#valid? ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/axiomus_api/validated.rb', line 4 def valid? @validation_errors = [] return true unless kind_of? ::AxiomusApi::Base self.class..each do |k, v| val = self.send(k) validate_field(k, val, v) end return !@validation_errors.any? end |