Class: ThemeSettingsObjectValidator::ThemeSettingsObjectErrors
- Inherits:
-
Object
- Object
- ThemeSettingsObjectValidator::ThemeSettingsObjectErrors
- Defined in:
- lib/theme_settings_object_validator.rb
Instance Method Summary collapse
- #add_error(error, i18n_opts = {}) ⇒ Object
- #full_messages ⇒ Object
- #humanize_messages(property_json_pointer) ⇒ Object
-
#initialize ⇒ ThemeSettingsObjectErrors
constructor
A new instance of ThemeSettingsObjectErrors.
Constructor Details
#initialize ⇒ ThemeSettingsObjectErrors
Returns a new instance of ThemeSettingsObjectErrors.
29 30 31 |
# File 'lib/theme_settings_object_validator.rb', line 29 def initialize @errors = [] end |
Instance Method Details
#add_error(error, i18n_opts = {}) ⇒ Object
33 34 35 |
# File 'lib/theme_settings_object_validator.rb', line 33 def add_error(error, i18n_opts = {}) @errors << ThemeSettingsObjectError.new(error, i18n_opts) end |
#full_messages ⇒ Object
41 42 43 |
# File 'lib/theme_settings_object_validator.rb', line 41 def @errors.map(&:error_message) end |
#humanize_messages(property_json_pointer) ⇒ Object
37 38 39 |
# File 'lib/theme_settings_object_validator.rb', line 37 def (property_json_pointer) @errors.map { |error| error.(property_json_pointer) } end |