Sha256: 5e3d2d55aa9695b46631ea154a5329ae9ecb5f37677f310e7490b7c9f101b713

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 Bytes

Contents

# frozen-string-literal: true
#
# The ruby18_symbol_extensions adds the <, <=, >, >= to Symbol
# to reflect the mathmatical operators.  It also adds the [] method
# to Symbol for creating SQL functions.
#
# Usage of this extension is not recommended. This extension will
# only load on ruby 1.8, so you will not be able to upgrade to
# newer ruby versions if you use it. If you still want to use it,
# you can load it via:
#
#   Sequel.extension :ruby18_symbol_extensions

raise(Sequel::Error, "The ruby18_symbol_extensions is only available on ruby 1.8.") unless RUBY_VERSION < '1.9.0'

class Symbol
  include Sequel::SQL::InequalityMethods

  # Create an SQL Function with the receiver as the function name
  # and the given arguments.
  def [](*args)
    Sequel::SQL::Function.new(self, *args)
  end
end

# SEQUEL5: Remove extension

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sequel-4.49.0 lib/sequel/extensions/ruby18_symbol_extensions.rb
sequel-4.48.0 lib/sequel/extensions/ruby18_symbol_extensions.rb