Class: Ldaptic::ErrorSet
Instance Method Summary collapse
- #add(attribute, message) ⇒ Object
- #each ⇒ Object
- #full_messages ⇒ Object
-
#initialize(base) ⇒ ErrorSet
constructor
A new instance of ErrorSet.
- #size ⇒ Object
- #to_a ⇒ Object
Methods included from Filter::Conversions
Constructor Details
#initialize(base) ⇒ ErrorSet
Returns a new instance of ErrorSet.
3 4 5 6 |
# File 'lib/ldaptic/error_set.rb', line 3 def initialize(base) @base = base super() { |h, k| h[k] = [] } end |
Instance Method Details
#add(attribute, message) ⇒ Object
8 9 10 |
# File 'lib/ldaptic/error_set.rb', line 8 def add(attribute, ) self[attribute] << end |
#each ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/ldaptic/error_set.rb', line 12 def each each_key do |attribute| self[attribute].each do || yield attribute, end end end |
#full_messages ⇒ Object
20 21 22 23 24 |
# File 'lib/ldaptic/error_set.rb', line 20 def map do |attribute, | "#{@base.class.human_attribute_name(attribute)} #{}" end end |
#size ⇒ Object
30 31 32 |
# File 'lib/ldaptic/error_set.rb', line 30 def size .size end |
#to_a ⇒ Object
26 27 28 |
# File 'lib/ldaptic/error_set.rb', line 26 def to_a end |