class method self.new

Ruby on Rails 3.2.22.5

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

self.new(options)

No documentation comment.

Parameters

options req
Source
# File activemodel/lib/active_model/validations/length.rb, line 12
      def initialize(options)
        if range = (options.delete(:in) || options.delete(:within))
          raise ArgumentError, ":in and :within must be a Range" unless range.is_a?(Range)
          options[:minimum], options[:maximum] = range.begin, range.end
          options[:maximum] -= 1 if range.exclude_end?
        end

        super
      end

Defined in activemodel/lib/active_model/validations/length.rb line 12 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Validations::LengthValidator

Type at least 2 characters to search.

↑↓ navigate · open · esc close