Sha256: 90b49f6f63ebb5a96b86a93331c029aae3a9e729ab9bd6c1d3bba67d52a44fb4

Contents?: true

Size: 616 Bytes

Versions: 13

Compression:

Stored size: 616 Bytes

Contents

require_relative "numeric_value/constants"

module Unicode
  module NumericValue
    def self.numeric_value(char)
      codepoint = char.unpack("U")[0] or
          raise(ArgumentError, "Unicode::NumericValue.numeric_value must be given a valid char")
      require_relative "numeric_value/index" unless defined? ::Unicode::NumericValue::INDEX
      INDEX[codepoint]
    end
    class << self; alias of numeric_value; end

    def self.chars
      require_relative "numeric_value/index" unless defined? ::Unicode::NumericValue::INDEX
      INDEX.keys.sort.map{ |codepoint| [codepoint].pack("U") }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
unicode-numeric_value-1.11.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.10.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.9.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.8.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.7.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.6.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.5.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.4.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.3.2 lib/unicode/numeric_value.rb
unicode-numeric_value-1.3.1 lib/unicode/numeric_value.rb
unicode-numeric_value-1.3.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.2.0 lib/unicode/numeric_value.rb
unicode-numeric_value-1.1.0 lib/unicode/numeric_value.rb