Sha256: 6b8ecf085bbe84893b41e2d0ce08881245858a56d78748e3d84612f25fa7467c
Contents?: true
Size: 632 Bytes
Versions: 5
Compression:
Stored size: 632 Bytes
Contents
# Copyright 2018 Twitter, Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # encoding: UTF-8 module Twitter module TwitterText class WeightedRange attr_reader :start, :end, :weight def initialize(range = {}) raise ArgumentError.new("Invalid range") unless [:start, :end, :weight].all? { |key| range.key?(key) && range[key].is_a?(Integer) } @start = range[:start] @end = range[:end] @weight = range[:weight] end def contains?(code_point) code_point >= @start && code_point <= @end end end end end
Version data entries
5 entries across 5 versions & 4 rubygems