Sha256: 6ace183533359da0efc10500b9caadddd75d7996a98a53af46aede7d7941fbdc
Contents?: true
Size: 788 Bytes
Versions: 13
Compression:
Stored size: 788 Bytes
Contents
# frozen_string_literal: true class AsciiCharacteristics < Characteristics BLANKS = [ 0x9, 0x20, ].freeze SEPARATORS = [ 0xA, 0xB, 0xC, 0xD, ].freeze def initialize(char) super @ord = char.ord if @is_valid end def valid? @is_valid && !(@encoding_name != "US-ASCII" && @ord >= 0x80) end def unicode? false end def assigned? true end def control? c0? || delete? end def c0? @is_valid && @ord < 0x20 end def delete? @is_valid && @ord == 0x7F end def c1? false end def blank? @is_valid && ( BLANKS.include?(@ord) || SEPARATORS.include?(@ord) ) end def separator? SEPARATORS.include?(@ord) end def format? false end def bidi_control? false end end
Version data entries
13 entries across 13 versions & 1 rubygems