Sha256: de6b0c5b3966e385bf6c7456c4f0eff21e8db7210bb851deb076f68a154a2ece

Contents?: true

Size: 573 Bytes

Versions: 12

Compression:

Stored size: 573 Bytes

Contents

module ROM
  module SQL
    # @api private
    class Index
      extend Initializer
      include Dry::Equalizer(:attributes, :name)

      param :attributes

      option :name, optional: true

      option :unique, default: -> { false }

      alias_method :unique?, :unique

      option :type, optional: true

      option :predicate, optional: true

      def to_a
        attributes
      end

      def partial?
        !predicate.nil?
      end

      def can_access?(attribute)
        !partial? && attributes[0].name == attribute.name
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/index.rb
rom-sql-3.0.1 lib/rom/sql/index.rb
rom-sql-3.0.0 lib/rom/sql/index.rb
rom-sql-2.5.0 lib/rom/sql/index.rb
rom-sql-2.4.0 lib/rom/sql/index.rb
rom-sql-2.3.0 lib/rom/sql/index.rb
rom-sql-2.2.1 lib/rom/sql/index.rb
rom-sql-2.2.0 lib/rom/sql/index.rb
rom-sql-2.1.0 lib/rom/sql/index.rb
rom-sql-2.0.0 lib/rom/sql/index.rb
rom-sql-2.0.0.rc1 lib/rom/sql/index.rb
rom-sql-2.0.0.beta3 lib/rom/sql/index.rb