Class: CIMD::Dcs
- Inherits:
-
Object
- Object
- CIMD::Dcs
- Defined in:
- lib/cimd_structures.rb
Overview
parameter
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #alphabet ⇒ Object
- #alphabet_set_UCS2 ⇒ Object
- #coding_group ⇒ Object
- #has_coding_group_zero? ⇒ Boolean
- #has_default_alphabet? ⇒ Boolean
-
#initialize(value) ⇒ Dcs
constructor
A new instance of Dcs.
- #set_value(value) ⇒ Object
Constructor Details
#initialize(value) ⇒ Dcs
Returns a new instance of Dcs.
67 68 69 |
# File 'lib/cimd_structures.rb', line 67 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
65 66 67 |
# File 'lib/cimd_structures.rb', line 65 def value @value end |
Instance Method Details
#alphabet ⇒ Object
87 88 89 90 91 92 93 |
# File 'lib/cimd_structures.rb', line 87 def alphabet if has_coding_group_zero? return (@value & 0b00001100) >> 2 else return 0 end end |
#alphabet_set_UCS2 ⇒ Object
95 96 97 |
# File 'lib/cimd_structures.rb', line 95 def alphabet_set_UCS2 value = 8 end |
#coding_group ⇒ Object
75 76 77 |
# File 'lib/cimd_structures.rb', line 75 def coding_group return @value & 0xF0 end |
#has_coding_group_zero? ⇒ Boolean
79 80 81 |
# File 'lib/cimd_structures.rb', line 79 def has_coding_group_zero? (@value & 0b11000000).zero? end |
#has_default_alphabet? ⇒ Boolean
83 84 85 |
# File 'lib/cimd_structures.rb', line 83 def has_default_alphabet? value.zero? end |
#set_value(value) ⇒ Object
71 72 73 |
# File 'lib/cimd_structures.rb', line 71 def set_value(value) @value = value.to_i end |