instance method load

Ruby on Rails 4.0.13

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

load()

Loads the Unicode database and returns all the internal objects of UnicodeDatabase.

Source
# File activesupport/lib/active_support/multibyte/unicode.rb, line 340
        def load
          begin
            @codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read }
          rescue => e
              raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable")
          end

          # Redefine the === method so we can write shorter rules for grapheme cluster breaks
          @boundary.each do |k,_|
            @boundary[k].instance_eval do
              def ===(other)
                detect { |i| i === other } ? true : false
              end
            end if @boundary[k].kind_of?(Array)
          end

          # define attr_reader methods for the instance variables
          class << self
            attr_reader(*ATTRIBUTES)
          end
        end

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

Defined in ActiveSupport::Multibyte::Unicode::UnicodeDatabase

Type at least 2 characters to search.

↑↓ navigate · open · esc close