Method: Validatable#validate
- Defined in:
- lib/musicality/validatable.rb
#validate ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/musicality/validatable.rb', line 14 def validate @errors = [] check_methods.each do |check_method| begin send(check_method) rescue StandardError => e @errors.push e end end validatables.each do |v| if v.respond_to?(:validate) @errors += v.validate end end return @errors end |