module Sequel::SQL::BitwiseMethods
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
.
:a.sql_number & :b # "a" & "b" :a.sql_number | :b # "a" | "b" :a.sql_number ^ :b # "a" ^ "b" :a.sql_number << :b # "a" << "b" :a.sql_number >> :b # "a" >> "b" ~:a.sql_number # ~"a"
Public Instance Methods
~()
click to toggle source
Do the bitwise compliment of the self
~(Sequel[:a].sql_number) # ~"a"
# File lib/sequel/sql.rb 267 def ~ 268 NumericExpression.new(:'B~', self) 269 end