Module: Quby::Questionnaires::DSL::Questions::RegexpValidations

Included in:
StringQuestionBuilder, TextQuestionBuilder
Defined in:
lib/quby/questionnaires/dsl/questions/base.rb

Instance Method Summary collapse

Instance Method Details

#validates_format_with(regexp, options = {}) ⇒ Object



56
57
58
59
# File 'lib/quby/questionnaires/dsl/questions/base.rb', line 56

def validates_format_with(regexp, options = {})
  @question.validations ||= []
  @question.validations << {type: :regexp, matcher: regexp}.reverse_merge(options)
end