Class: BareTypes::U8

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

Overview

region Integers

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



25
26
27
# File 'lib/generative_testing/monkey_patch.rb', line 25

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

Instance Method Details

#create_inputObject



29
30
31
# File 'lib/generative_testing/monkey_patch.rb', line 29

def create_input
  rand(256)
end

#decode(msg) ⇒ Object



307
308
309
# File 'lib/types.rb', line 307

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

#encode(msg, buffer) ⇒ Object



303
304
305
# File 'lib/types.rb', line 303

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