class ParsleySimpleForm::Constraints::Basics::RangecheckConstraint

Public Instance Methods

html_attributes() click to toggle source
# File lib/parsley_simple_form/constraints/basics/rangecheck_constraint.rb, line 12
def html_attributes
  range = parse_range(@options[:rangecheck])
  attributes = {
    :'data-parsley-rangecheck' => range[:string],
    :'data-parsley-rangecheck-message' => I18n::translate('form_validation.message.ragecheck', min: range[:min], max: range[:max])
  }
  attributes.merge!({:'data-parsley-group' => @options[:check_group]}) unless @options[:check_group].nil?
  attributes
end
match?() click to toggle source
# File lib/parsley_simple_form/constraints/basics/rangecheck_constraint.rb, line 7
def match?
  return false if @options.nil?
  !@options[:rangecheck].nil?
end