Sha256: 5a9c4a076aa00c6dbaaa14457b7bccbbe88b822bc0411e585f97af2525298248

Contents?: true

Size: 843 Bytes

Versions: 18

Compression:

Stored size: 843 Bytes

Contents

# Copyright 2020 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.

module ActiveRecordSpannerAdapter
  class Index
    class Column
      attr_accessor :table_name, :index_name, :name, :order, :ordinal_position

      def initialize \
          table_name,
          index_name,
          name,
          order: nil,
          ordinal_position: nil
        @table_name = table_name.to_s
        @index_name = index_name.to_s
        @name = name.to_s
        @order = order.to_s.upcase if order
        @ordinal_position = ordinal_position
      end

      def storing?
        @ordinal_position.nil?
      end

      def desc?
        @order == "DESC"
      end

      def desc!
        @order = "DESC"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.6.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.5.1 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.5.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.4.4 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.4.3 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.4.2 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.4.1 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.4.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.3.1 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.2.2 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.2.1 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.2.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.1.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.0.1 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-1.0.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-0.7.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-0.6.0 lib/activerecord_spanner_adapter/index/column.rb
activerecord-spanner-adapter-0.5.0 lib/activerecord_spanner_adapter/index/column.rb