class ByteCharacteristics
Constants
- BLANKS
- EXTRA_BLANKS
- FORMATS
- HAS_C1
- SEPARATORS
- UNASSIGNED
Public Class Methods
new(char)
click to toggle source
Calls superclass method
Characteristics::new
# File lib/characteristics/byte.rb, line 151 def initialize(char) super @ord = char.ord end
Public Instance Methods
assigned?()
click to toggle source
# File lib/characteristics/byte.rb, line 160 def assigned? control? || UNASSIGNED[@ord] !~ @encoding_name end
bidi_control?()
click to toggle source
# File lib/characteristics/byte.rb, line 194 def bidi_control? format? end
blank?()
click to toggle source
# File lib/characteristics/byte.rb, line 180 def blank? BLANKS.include?(@ord) || SEPARATORS.include?(@ord) || EXTRA_BLANKS[@ord] =~ @encoding_name end
c0?()
click to toggle source
# File lib/characteristics/byte.rb, line 168 def c0? @ord < 0x20 && encoding_has_c0? end
c1?()
click to toggle source
# File lib/characteristics/byte.rb, line 172 def c1? @ord >= 0x80 && @ord < 0xA0 && encoding_has_c1? end
control?()
click to toggle source
# File lib/characteristics/byte.rb, line 164 def control? c0? || c1? || delete? end
delete?()
click to toggle source
# File lib/characteristics/byte.rb, line 176 def delete? @ord == 0x7F && encoding_has_delete? end
format?()
click to toggle source
# File lib/characteristics/byte.rb, line 190 def format? FORMATS[@ord] =~ @encoding_name end
separator?()
click to toggle source
# File lib/characteristics/byte.rb, line 186 def separator? SEPARATORS.include?(@ord) end
unicode?()
click to toggle source
# File lib/characteristics/byte.rb, line 156 def unicode? false end
Private Instance Methods
encoding_has_c1?()
click to toggle source
# File lib/characteristics/byte.rb, line 200 def encoding_has_c1? !!(HAS_C1 =~ @encoding_name) end