Class: ActiveRecord::Refined::AST::BitwiseNot
- Includes:
- Arithmetics, BitwiseOperands, Predications
- Defined in:
- lib/active_record/refined/ast.rb
Overview
~, which every adapter has. MySQL answers with the unsigned 64-bit number where the others answer with a negative one; the bits are the same, and only reading the value back tells them apart.
Instance Attribute Summary collapse
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
Instance Method Summary collapse
-
#initialize(operand) ⇒ BitwiseNot
constructor
A new instance of BitwiseNot.
- #to_arel(table, model) ⇒ Object
Methods included from Arithmetics
#&, #*, #+, #-, #/, #<<, #>>, #^, #|, #~
Methods included from Predications
#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #bury, #casecmp?, #contains?, #dig, #dig_json, #distinct_from?, #end_with?, #false?, #ilike?, #in?, #include?, #intersect?, #key?, #like?, #member?, #not_between?, #not_distinct_from?, #not_false?, #not_ilike?, #not_in?, #not_like?, #not_null?, #not_true?, #null?, #start_with?, #subset?, #superset?, #true?, #when
Methods inherited from Node
Constructor Details
#initialize(operand) ⇒ BitwiseNot
Returns a new instance of BitwiseNot.
811 812 813 |
# File 'lib/active_record/refined/ast.rb', line 811 def initialize(operand) @operand = check_operand(operand, :~) end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
809 810 811 |
# File 'lib/active_record/refined/ast.rb', line 809 def operand @operand end |
Instance Method Details
#to_arel(table, model) ⇒ Object
815 816 817 818 819 |
# File 'lib/active_record/refined/ast.rb', line 815 def to_arel(table, model) check_not_boolean(operand, :~, model) Arel::Nodes::Grouping.new( Arel::Nodes::BitwiseNot.new(to_arel_operand(operand, table, model))) end |