instance method in_char_class?

Ruby on Rails 4.1.16

Since v3.0.20 Last seen in v5.2.8.1

Available in: v3.0.20 v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1

Signature

in_char_class?(codepoint, classes)

Detect whether the codepoint is in a certain character class. Returns true when it’s in the specified character class and false otherwise. Valid character classes are: :cr, :lf, :l, :v, :lv, :lvt and :t.

Primarily used by the grapheme cluster support.

Parameters

codepoint req
classes req
Source
# File activesupport/lib/active_support/multibyte/unicode.rb, line 72
      def in_char_class?(codepoint, classes)
        classes.detect { |c| database.boundary[c] === codepoint } ? true : false
      end

Defined in activesupport/lib/active_support/multibyte/unicode.rb line 72 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Multibyte::Unicode

Type at least 2 characters to search.

↑↓ navigate · open · esc close