Class: ThemeSettingsObjectValidator::ThemeSettingsObjectError
- Inherits:
-
Object
- Object
- ThemeSettingsObjectValidator::ThemeSettingsObjectError
- Defined in:
- lib/theme_settings_object_validator.rb
Instance Method Summary collapse
- #error_message ⇒ Object
- #humanize_messages(property_json_pointer) ⇒ Object
-
#initialize(error, i18n_opts = {}) ⇒ ThemeSettingsObjectError
constructor
A new instance of ThemeSettingsObjectError.
Constructor Details
#initialize(error, i18n_opts = {}) ⇒ ThemeSettingsObjectError
Returns a new instance of ThemeSettingsObjectError.
46 47 48 49 |
# File 'lib/theme_settings_object_validator.rb', line 46 def initialize(error, i18n_opts = {}) @error = error @i18n_opts = i18n_opts end |
Instance Method Details
#error_message ⇒ Object
58 59 60 |
# File 'lib/theme_settings_object_validator.rb', line 58 def I18n.t("themes.settings_errors.objects.#{@error}", @i18n_opts) end |
#humanize_messages(property_json_pointer) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/theme_settings_object_validator.rb', line 51 def (property_json_pointer) I18n.t( "themes.settings_errors.objects.humanize_#{@error}", @i18n_opts.merge(property_json_pointer:), ) end |