I need a ruby equivalent for the following python code
import array
my_array = array.array('B', [0x00, 0x04, 0xcc, 0x50]).tostring()
UPDATE: I am trying to write 4 bytes to the serial port using ruby-serialport gem.
I was able to make it work in python by writing the above byte array to the serial port. Now I am trying to do the same in ruby.
['B', [0x00, 0x04, 0xcc, 0x50]].to_s?