Class: Auctify::ServiceErrors
- Inherits:
-
Hash
- Object
- Hash
- Auctify::ServiceErrors
- Defined in:
- app/services/auctify/service_base.rb
Instance Method Summary collapse
- #add(key, value, _opts = {}) ⇒ Object
- #add_from_hash(errors_hash) ⇒ Object
- #each_one ⇒ Object
- #full_messages ⇒ Object
Instance Method Details
#add(key, value, _opts = {}) ⇒ Object
15 16 17 18 19 |
# File 'app/services/auctify/service_base.rb', line 15 def add(key, value, _opts = {}) self[key] ||= [] self[key] << value self[key].uniq! end |
#add_from_hash(errors_hash) ⇒ Object
21 22 23 24 25 |
# File 'app/services/auctify/service_base.rb', line 21 def add_from_hash(errors_hash) errors_hash.each do |key, values| values.each { |value| add key, value } end end |
#each_one ⇒ Object
33 34 35 36 37 |
# File 'app/services/auctify/service_base.rb', line 33 def each_one each_pair do |field, | .each { || yield field, } end end |
#full_messages ⇒ Object
27 28 29 30 31 |
# File 'app/services/auctify/service_base.rb', line 27 def f_msgs = [] each_one { |field, | f_msgs << "#{field}: #{}" } f_msgs end |