Holds static data from the Unicode database
Methods
Constants
ATTRIBUTES | = | :codepoints, :composition_exclusion, :composition_map, :boundary, :cp1252 |
Class Public methods
Returns the directory in which the data files are stored
Returns the filename for the data file for this version
Instance Public methods
Loads the Unicode database and returns all the internal objects of UnicodeDatabase.
# File activesupport/lib/active_support/multibyte/unicode.rb, line 343 343: def load 344: begin 345: @codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read } 346: rescue Exception => e 347: raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable") 348: end 349: 350: # Redefine the === method so we can write shorter rules for grapheme cluster breaks 351: @boundary.each do |k,_| 352: @boundary[k].instance_eval do 353: def ===(other) 354: detect { |i| i === other } ? true : false 355: end 356: end if @boundary[k].kind_of?(Array) 357: end 358: 359: # define attr_reader methods for the instance variables 360: class << self 361: attr_reader(*ATTRIBUTES) 362: end 363: end