class

ActiveModel::Errors

Inherits Enumerable < Reference < Object

Constructors

new

Instance methods

<<(error : Error) : Nil
[](attribute : String | Symbol) : Array(String)

errors[:name] → message strings for the attribute.

add(attribute : String | Symbol, message : String, type : Symbol = :invalid, strict : Bool = false, detail_value : Value | Nil = nil) : Nil
add(attribute : String | Symbol, type : Symbol, detail_value : Value | Nil = nil) : Nil
added?(attribute : String | Symbol, type : Symbol) : Bool
as_json
attribute_names
clear
count
delete(attribute : String | Symbol) : Array(Error)
details
each

Must yield this collection's elements to the block.

empty?

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.
full_messages
full_messages_for(attribute : String | Symbol) : Array(String)
group_by_attribute
include?(attribute : String | Symbol) : Bool
messages
size

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4
where(attribute : String | Symbol, type : Symbol) : Array(Error)
where(attribute : String | Symbol) : Array(Error)

Nested types