Top Level Namespace
Defined Under Namespace
Modules: DicomUID
Classes: LeadingZeroError, OddByteError, OversizedUIDError
Instance Method Summary
collapse
Instance Method Details
#add_missing_dot(comp) ⇒ Object
102
103
104
105
106
107
108
109
|
# File 'lib/dicom_uid.rb', line 102
def add_missing_dot comp
raise TypeError unless comp.is_a? String
if comp[-1] != '.'
comp << '.'
return true
end
false
end
|
#leading_zero?(org_root) ⇒ Boolean
116
117
118
|
# File 'lib/dicom_uid.rb', line 116
def leading_zero? org_root
org_root[0] == '0' and org_root.length != 1
end
|
#odd_byte_rule(comp) ⇒ Object
111
112
113
114
|
# File 'lib/dicom_uid.rb', line 111
def odd_byte_rule comp
return comp[-1].to_i % 2 == 0 || (comp[-2].to_i % 2 == 1 && comp[-1].to_i == 0) if comp.length != 1
comp[-1].to_i % 2 == 0
end
|