Module: LIVR

Defined in:
lib/livr.rb,
lib/livr/rule.rb,
lib/livr/validator.rb,
lib/livr/rules/meta.rb,
lib/livr/aliased_rule.rb,
lib/livr/rules/common.rb,
lib/livr/rules/string.rb,
lib/livr/rules/numeric.rb,
lib/livr/rules/special.rb,
lib/livr/rules/modifiers.rb

Defined Under Namespace

Modules: Rules Classes: AliasedRule, Rule, Validator

Constant Summary collapse

DEFAULT_RULES =
{
  required:       Rules::Common::Required,
  not_empty:      Rules::Common::NotEmpty,
  not_empty_list: Rules::Common::NotEmptyList,
  any_object:     Rules::Common::AnyObject,

  string:         Rules::String::String,
  eq:             Rules::String::Eq,
  one_of:         Rules::String::OneOf,
  max_length:     Rules::String::MaxLength,
  min_length:     Rules::String::MinLength,
  length_equal:   Rules::String::LengthEqual,
  length_between: Rules::String::LengthBetween,
  like:           Rules::String::Like,

  integer:          Rules::Numeric::Integer,
  positive_integer: Rules::Numeric::PositiveInteger,
  decimal:          Rules::Numeric::Decimal,
  positive_decimal: Rules::Numeric::PositiveDecimal,
  max_number:       Rules::Numeric::MaxNumber,
  min_number:       Rules::Numeric::MinNumber,
  number_between:   Rules::Numeric::NumberBetween,

  email:          Rules::Special::Email,
  equal_to_field: Rules::Special::EqualToField,
  url:            Rules::Special::Url,
  iso_date:       Rules::Special::IsoDate,

  default:    Rules::Modifiers::Default,
  trim:       Rules::Modifiers::Trim,
  to_lc:      Rules::Modifiers::ToLc,
  to_uc:      Rules::Modifiers::ToUc,
  remove:     Rules::Modifiers::Remove,
  leave_only: Rules::Modifiers::LeaveOnly,

  nested_object:             Rules::Meta::NestedObject,
  variable_object:           Rules::Meta::VariableObject,
  list_of:                   Rules::Meta::ListOf,
  list_of_objects:           Rules::Meta::ListOfObjects,
  list_of_different_objects: Rules::Meta::ListOfDifferentObjects,
  or:                        Rules::Meta::Or,
}.with_indifferent_access