سؤال

The code below doesn't work, yet the type boolean exists and I used it in another class the same way, why doesn't it work here?

require 'bindata'
class TESTSTUFF < BinData::Record
  array  :boolstuff, :type => :boolean, :initial_length => 8
end

The error is: unknown type 'boolean' in TESTSTUFF (TypeError)

هل كانت مفيدة؟

المحلول

There is no such parameter as boolean in bindata. Use bit1 that's a 1-bit big endian integer and may be used as boolean. Look at the docs.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top