class Form::ActiveModel::Validations::Result

The idea here to mimic Dry.RB's Result API.

Public Class Methods

new(success, hash) click to toggle source
Calls superclass method
# File lib/reform/form/active_model/validations.rb, line 101
def initialize(success, hash)
  super()
  @success = success
  hash.each { |k,v| self[k] = v }
end

Public Instance Methods

errors() click to toggle source

DISCUSS @FRAN: not sure this is 100% compatible with AMV::Errors?

# File lib/reform/form/active_model/validations.rb, line 120
def errors
  self
end
failure?() click to toggle source
# File lib/reform/form/active_model/validations.rb, line 111
def failure?
  ! success?
end
messages() click to toggle source
# File lib/reform/form/active_model/validations.rb, line 115
def messages
  self
end
success?() click to toggle source
# File lib/reform/form/active_model/validations.rb, line 107
def success?
  @success
end