Class: BareTypes::I64

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



95
96
97
# File 'lib/generative_testing/monkey_patch.rb', line 95

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

Instance Method Details

#create_inputObject



99
100
101
# File 'lib/generative_testing/monkey_patch.rb', line 99

def create_input
  rand(2 ** 64) - (2 ** 63)
end

#decode(msg) ⇒ Object



377
378
379
# File 'lib/types.rb', line 377

def decode(msg)
  return msg.unpack('q<')[0], msg[8..msg.size]
end

#encode(msg, buffer) ⇒ Object



373
374
375
# File 'lib/types.rb', line 373

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