Class: MarkdownTypographerQuotationMarksValidator
- Inherits:
-
Object
- Object
- MarkdownTypographerQuotationMarksValidator
- Defined in:
- lib/validators/markdown_typographer_quotation_marks_validator.rb
Constant Summary collapse
- QUOTE_COUNT =
4
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(opts = {}) ⇒ MarkdownTypographerQuotationMarksValidator
constructor
A new instance of MarkdownTypographerQuotationMarksValidator.
- #valid_value?(value) ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ MarkdownTypographerQuotationMarksValidator
Returns a new instance of MarkdownTypographerQuotationMarksValidator.
6 7 8 |
# File 'lib/validators/markdown_typographer_quotation_marks_validator.rb', line 6 def initialize(opts = {}) @opts = opts end |
Instance Method Details
#error_message ⇒ Object
14 15 16 |
# File 'lib/validators/markdown_typographer_quotation_marks_validator.rb', line 14 def I18n.t("site_settings.errors.list_value_count", count: QUOTE_COUNT) end |
#valid_value?(value) ⇒ Boolean
10 11 12 |
# File 'lib/validators/markdown_typographer_quotation_marks_validator.rb', line 10 def valid_value?(value) value.present? && value.split("|").size == QUOTE_COUNT end |