Class: WipeOut::ValidationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/wipe_out/validate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidationResult

Returns a new instance of ValidationResult.



36
37
38
# File 'lib/wipe_out/validate.rb', line 36

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



34
35
36
# File 'lib/wipe_out/validate.rb', line 34

def errors
  @errors
end

Instance Method Details

#add_error(message) ⇒ Object



44
45
46
# File 'lib/wipe_out/validate.rb', line 44

def add_error(message)
  @errors << message
end

#valid?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/wipe_out/validate.rb', line 40

def valid?
  !errors.any?
end