Class: ParsleySimpleForm::Constraints::Basics::RangeConstraint

Inherits:
ParsleySimpleForm::Constraints::BaseConstraint show all
Includes:
ParsleySimpleForm::Concerns::RangeConcern
Defined in:
lib/parsley_simple_form/constraints/basics/range_constraint.rb

Instance Method Summary collapse

Methods inherited from ParsleySimpleForm::Constraints::BaseConstraint

#initialize, #input_id, #input_type

Constructor Details

This class inherits a constructor from ParsleySimpleForm::Constraints::BaseConstraint

Instance Method Details

#html_attributesObject



11
12
13
14
15
16
17
# File 'lib/parsley_simple_form/constraints/basics/range_constraint.rb', line 11

def html_attributes
  range = parse_range(@options[:range])
  {
    :'data-parsley-range' => range[:string],
    :'data-parsley-range-message' => I18n::translate('form_validation.message.range', min: range[:min], max: range[:max])
  }
end

#match?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/parsley_simple_form/constraints/basics/range_constraint.rb', line 7

def match?
  !@options[:range].nil?
end