Class: BareTypes::U64

Inherits:
BarePrimitive show all
Defined in:
lib/types.rb,
lib/generative_testing/monkey_patch.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BarePrimitive

#==, #finalize_references, #to_schema

Methods inherited from BaseType

#cycle_search, #initialize

Constructor Details

This class inherits a constructor from BareTypes::BaseType

Class Method Details

.make(depth, names) ⇒ Object



55
56
57
# File 'lib/generative_testing/monkey_patch.rb', line 55

def self.make(depth, names)
  BareTypes::U64.new
end

Instance Method Details

#create_inputObject



59
60
61
# File 'lib/generative_testing/monkey_patch.rb', line 59

def create_input
  rand(2 ** 64)
end

#decode(msg) ⇒ Object



337
338
339
# File 'lib/types.rb', line 337

def decode(msg)
  return msg.unpack("Q")[0], msg[8..msg.size]
end

#encode(msg, buffer) ⇒ Object



333
334
335
# File 'lib/types.rb', line 333

def encode(msg, buffer)
  buffer << [msg].pack("Q")
end