class ParsleySimpleForm::Constraints::Basics::RegexpConstraint

Public Instance Methods

html_attributes() click to toggle source
# File lib/parsley_simple_form/constraints/basics/regexp_constraint.rb, line 16
def html_attributes
  {:'data-parsley-regexp-message' => I18n::translate('form_validation.message.regexp'),
    :pattern => @regexp}
end
match?() click to toggle source
# File lib/parsley_simple_form/constraints/basics/regexp_constraint.rb, line 5
def match?
  return false if @options.nil?
  
  if @options[:regexp].nil?
    @regexp = @options[:input_html][:regexp] unless @options[:input_html].nil?
  else
    @regexp = @options[:regexp]
  end
  !@regexp.nil?
end