Class: Sequel::SQL::Blob

Inherits:
String show all
Includes:
AliasMethods, CastMethods
Defined in:
lib/sequel/sql.rb

Overview

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.

Instance Method Summary (collapse)

Methods included from CastMethods

#cast, #cast_numeric, #cast_string

Methods included from AliasMethods

#as

Methods inherited from String

#blank?, #camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, inflections, #pluralize, #singularize, #tableize, #titleize, #to_date, #to_datetime, #to_sequel_time, #to_time, #underscore

Instance Method Details

- (Object) lit(*args)

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.



960
961
962
# File 'lib/sequel/sql.rb', line 960

def lit(*args)
  args.empty? ? LiteralString.new(self) : SQL::PlaceholderLiteralString.new(self, args)
end

- (Object) to_sequel_blob

Returns self, since it is already a blob.



965
966
967
# File 'lib/sequel/sql.rb', line 965

def to_sequel_blob
  self
end