Class: Depix::U16Field
Constant Summary
collapse
- BLANK =
0xFFFF
Instance Attribute Summary
Attributes inherited from Field
#desc, #name, #req
Instance Method Summary
collapse
Methods inherited from Field
#consume!, emit_char, emit_r32, emit_u16, emit_u32, emit_u8, #explain, #initialize, #pack
Constructor Details
This class inherits a constructor from Depix::Field
Instance Method Details
#clean(v) ⇒ Object
187
188
189
|
# File 'lib/depix/dict.rb', line 187
def clean(v)
v == BLANK ? nil : v
end
|
#length ⇒ Object
179
180
181
|
# File 'lib/depix/dict.rb', line 179
def length
2
end
|
#pattern ⇒ Object
175
176
177
|
# File 'lib/depix/dict.rb', line 175
def pattern
"n"
end
|
#rtype ⇒ Object
183
184
185
|
# File 'lib/depix/dict.rb', line 183
def rtype
Integer
end
|
#validate!(value) ⇒ Object
191
192
193
194
|
# File 'lib/depix/dict.rb', line 191
def validate!(value)
super(value)
raise "#{name} value #{value} out of bounds for 16bit unsigned int" if (value < 0 || value >= BLANK)
end
|