class Sequel::SQL::Blob
Blob
is used to represent binary data in the Ruby environment that is stored as a blob type in the database. Sequel
represents binary data as a Blob
object because most database engines require binary data to be escaped differently than regular strings.
Public Instance Methods
inspect()
click to toggle source
Return a string showing that this is a blob, the size, and the some or all of the content, depending on the size.
# File lib/sequel/sql.rb 1036 def inspect 1037 size = length 1038 1039 content = if size > 20 1040 "start=#{self[0...10].to_s.inspect} end=#{self[-10..-1].to_s.inspect}" 1041 else 1042 "content=#{super}" 1043 end 1044 1045 "#<#{self.class}:0x#{"%x" % object_id} bytes=#{size} #{content}>" 1046 end
lit(*args)
click to toggle source
Return a LiteralString
with the same content if no args are given, otherwise return a SQL::PlaceholderLiteralString
with the current string and the given args.
# File lib/sequel/sql.rb 1030 def lit(*args) 1031 args.empty? ? LiteralString.new(self) : SQL::PlaceholderLiteralString.new(self, args) 1032 end
to_sequel_blob()
click to toggle source
Returns self
, since it is already a blob.
# File lib/sequel/sql.rb 1049 def to_sequel_blob 1050 self 1051 end