Class: BinaryCharacteristics
Constant Summary
collapse
- BLANKS =
[
0x9,
0x20,
].freeze
- SEPARATORS =
[
0xA,
0xB,
0xC,
0xD,
].freeze
Characteristics::UNICODE_VERSION, Characteristics::VERSION
Instance Attribute Summary
#encoding
Instance Method Summary
collapse
create, create_for_type, #docomo?, #kddi?, #softbank?, type_from_encoding_name
Constructor Details
Returns a new instance of BinaryCharacteristics.
16
17
18
19
20
|
# File 'lib/characteristics/binary.rb', line 16
def initialize(char)
@ord = char.ord
@encoding = char.encoding
@encoding_name = @encoding.name
end
|
Instance Method Details
#assigned? ⇒ Boolean
30
31
32
|
# File 'lib/characteristics/binary.rb', line 30
def assigned?
true
end
|
#bidi_control? ⇒ Boolean
62
63
64
|
# File 'lib/characteristics/binary.rb', line 62
def bidi_control?
false
end
|
#blank? ⇒ Boolean
50
51
52
|
# File 'lib/characteristics/binary.rb', line 50
def blank?
BLANKS.include?(@ord) || SEPARATORS.include?(@ord)
end
|
#c0? ⇒ Boolean
38
39
40
|
# File 'lib/characteristics/binary.rb', line 38
def c0?
@ord < 0x20
end
|
#c1? ⇒ Boolean
46
47
48
|
# File 'lib/characteristics/binary.rb', line 46
def c1?
false
end
|
#control? ⇒ Boolean
34
35
36
|
# File 'lib/characteristics/binary.rb', line 34
def control?
c0? || delete?
end
|
#delete? ⇒ Boolean
42
43
44
|
# File 'lib/characteristics/binary.rb', line 42
def delete?
@ord == 0x7F
end
|
58
59
60
|
# File 'lib/characteristics/binary.rb', line 58
def format?
false
end
|
#separator? ⇒ Boolean
54
55
56
|
# File 'lib/characteristics/binary.rb', line 54
def separator?
SEPARATORS.include?(@ord)
end
|
#unicode? ⇒ Boolean
26
27
28
|
# File 'lib/characteristics/binary.rb', line 26
def unicode?
false
end
|
#valid? ⇒ Boolean
22
23
24
|
# File 'lib/characteristics/binary.rb', line 22
def valid?
true
end
|