class Schema::Errors
Schema::Errors
used internally for testing mainly, recommend using ActiveModel::Validations
Constants
- EMPTY_ARRAY
Attributes
errors[R]
Public Class Methods
new()
click to toggle source
# File lib/schema/errors.rb, line 10 def initialize @errors = {} end
Public Instance Methods
[](name)
click to toggle source
# File lib/schema/errors.rb, line 14 def [](name) @errors[name] || EMPTY_ARRAY end
add(name, error)
click to toggle source
# File lib/schema/errors.rb, line 18 def add(name, error) @errors[name] ||= [] @errors[name] << error end
Also aliased as: []=
empty?()
click to toggle source
# File lib/schema/errors.rb, line 24 def empty? @errors.empty? end