Class: BinaryCharacteristics
Constant Summary
collapse
- BLANKS =
[
0x9,
0x20,
].freeze
- SEPARATORS =
[
0xA,
0xB,
0xC,
0xD,
].freeze
Characteristics::VERSION
Instance Attribute Summary
#encoding
Instance Method Summary
collapse
create, create_for_type, type_from_encoding_name, #unicode?
Constructor Details
Returns a new instance of BinaryCharacteristics.
14
15
16
17
18
|
# File 'lib/characteristics/binary.rb', line 14
def initialize(char)
@ord = char.ord
@encoding = char.encoding
@encoding_name = @encoding.name
end
|
Instance Method Details
#assigned? ⇒ Boolean
24
25
26
|
# File 'lib/characteristics/binary.rb', line 24
def assigned?
true
end
|
#blank? ⇒ Boolean
40
41
42
|
# File 'lib/characteristics/binary.rb', line 40
def blank?
BLANKS.include?(@ord) || SEPARATORS.include?(@ord)
end
|
#c0? ⇒ Boolean
32
33
34
|
# File 'lib/characteristics/binary.rb', line 32
def c0?
@ord < 0x20
end
|
#control? ⇒ Boolean
28
29
30
|
# File 'lib/characteristics/binary.rb', line 28
def control?
c0? || delete?
end
|
#delete? ⇒ Boolean
36
37
38
|
# File 'lib/characteristics/binary.rb', line 36
def delete?
@ord == 0x7F
end
|
#valid? ⇒ Boolean
20
21
22
|
# File 'lib/characteristics/binary.rb', line 20
def valid?
true
end
|