module Sequel::SQL::BitwiseMethods

  1. lib/sequel/sql.rb

This defines the bitwise methods: &, |, ^, ~, <<, and >>. Because these methods overlap with the standard +BooleanMethods methods+, and they only make sense for integers, they are only included in NumericExpression.

Sequel[:a].sql_number & :b # "a" & "b"
Sequel[:a].sql_number | :b # "a" | "b"
Sequel[:a].sql_number ^ :b # "a" ^ "b"
Sequel[:a].sql_number << :b # "a" << "b"
Sequel[:a].sql_number >> :b # "a" >> "b"
~Sequel[:a].sql_number # ~"a"

Methods

Public Instance

  1. ~

Public Instance methods

~()

Do the bitwise compliment of the self

~(Sequel[:a].sql_number) # ~"a"
[show source]
    # File lib/sequel/sql.rb
286 def ~
287   NumericExpression.new(:'B~', self)
288 end