Class: BareTypes::I8

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



65
66
67
# File 'lib/generative_testing/monkey_patch.rb', line 65

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

Instance Method Details

#create_inputObject



69
70
71
# File 'lib/generative_testing/monkey_patch.rb', line 69

def create_input
  rand(2 ** 8) - (2 ** 7)
end

#decode(msg) ⇒ Object



347
348
349
# File 'lib/types.rb', line 347

def decode(msg)
  return msg[0].unpack("c")[0], msg[1..msg.size]
end

#encode(msg, buffer) ⇒ Object



343
344
345
# File 'lib/types.rb', line 343

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