class Twitter::TwitterText::WeightedRange
Attributes
end[R]
start[R]
weight[R]
Public Class Methods
new(range = {})
click to toggle source
# File lib/twitter-text/weighted_range.rb, line 12 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
Public Instance Methods
contains?(code_point)
click to toggle source
# File lib/twitter-text/weighted_range.rb, line 19 def contains?(code_point) code_point >= @start && code_point <= @end end