instance method
in_char_class?
Ruby on Rails 4.1.16
Since v3.0.20 Last seen in v5.2.8.1Signature
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
-
codepointreq -
classesreq
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