Sha256: ec1aec3e9a76ee311a5e3e28f9a531971c328fff31ad91cf9b0bcdbeb271f723
Contents?: true
Size: 398 Bytes
Versions: 20
Compression:
Stored size: 398 Bytes
Contents
# private module Simple::SQL::Encoder extend self extend Forwardable delegate connection: ::Simple::SQL def encode_args(args) args.map { |arg| encode_arg(arg) } end def encode_arg(arg) return arg unless arg.is_a?(Array) if arg.first.is_a?(String) "{#{arg.map { |a| "\"#{connection.escape(a)}\"" }.join(',')}}" else "{#{arg.join(',')}}" end end end
Version data entries
20 entries across 20 versions & 1 rubygems