I make this simple MySQL query using ActiveRecord::Base
sql = "SELECT * FROM schedules WHERE id = 1"
schedule = (ActiveRecord::Base.connection.select_rows sql)[0]
It happens that schedule[9] is BLOB data, but it gets retrieved as a ruby String object. Is that normal? How are BLOB objects represented in ruby? Coming from the Objective-C world, BLOB data is usually represented by NSData objects. Is there some kind of equivalent in Ruby?
Strings in ruby are just a sequence of arbitrary bytes – there is no separate data type.
Strings can be given an encoding which tells ruby to interpret the bytes as utf-8, utf-16, ISO-latin etc. when doing various operations on them but there’s also the ASCII-8bit encoding (bit of a misnomer) which just means arbitrary bytes.