Class: CIMD::Dcs

Inherits:
Object
  • Object
show all
Defined in:
lib/cimd_structures.rb

Overview

parameter

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

Returns the value of attribute value.



65
66
67
# File 'lib/cimd_structures.rb', line 65

def value
  @value
end

Instance Method Details

#alphabetObject



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_UCS2Object



95
96
97
# File 'lib/cimd_structures.rb', line 95

def alphabet_set_UCS2
  value = 8
end

#coding_groupObject



75
76
77
# File 'lib/cimd_structures.rb', line 75

def coding_group
  return @value & 0xF0
end

#has_coding_group_zero?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/cimd_structures.rb', line 79

def has_coding_group_zero?
  (@value & 0b11000000).zero?
end

#has_default_alphabet?Boolean

Returns:

  • (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