Sha256: 783cde4a6b87e5255c2b196ecf739a38f34993bb155ef28503cbe311f8086550

Contents?: true

Size: 927 Bytes

Versions: 5

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true
module Arel
  module Nodes
    class UpdateStatement < Arel::Nodes::Node
      attr_accessor :relation, :wheres, :values, :orders, :limit
      attr_accessor :key

      def initialize
        @relation = nil
        @wheres   = []
        @values   = []
        @orders   = []
        @limit    = nil
        @key      = nil
      end

      def initialize_copy other
        super
        @wheres = @wheres.clone
        @values = @values.clone
      end

      def hash
        [@relation, @wheres, @values, @orders, @limit, @key].hash
      end

      def eql? other
        self.class == other.class &&
          self.relation == other.relation &&
          self.wheres == other.wheres &&
          self.values == other.values &&
          self.orders == other.orders &&
          self.limit == other.limit &&
          self.key == other.key
      end
      alias :== :eql?
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
spiral_form-0.1.1 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/update_statement.rb
spiral_form-0.1.0 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/update_statement.rb
nullifyable-0.1.0 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/update_statement.rb
arel-9.0.0 lib/arel/nodes/update_statement.rb
arel-8.0.0 lib/arel/nodes/update_statement.rb