class Depix::Binary::Fields::U16Field

uint16 field

Constants

BLANK

Public Instance Methods

clean(v) click to toggle source
# File lib/depix/binary/fields.rb, line 151
def clean(v)
  (v == BLANK || v == -1) ? nil : v
end
length() click to toggle source
# File lib/depix/binary/fields.rb, line 143
def length
  2
end
pattern() click to toggle source
# File lib/depix/binary/fields.rb, line 139
def pattern
  "n"
end
rtype() click to toggle source
# File lib/depix/binary/fields.rb, line 147
def rtype
  Integer
end
validate!(value) click to toggle source
Calls superclass method Depix::Binary::Fields::Field#validate!
# File lib/depix/binary/fields.rb, line 155
def validate!(value)
  super(value)
  raise "#{name} value #{value} out of bounds for 16bit unsigned int" if (value < 0 || value >= BLANK)
end