Sha256: 645cb2f7c0aef2b1e6c245c261d0a1648d32aba6d38ae38abad4c6f0dafa17ec

Contents?: true

Size: 534 Bytes

Versions: 4

Compression:

Stored size: 534 Bytes

Contents

module AgnosticBackend
  module Queryable
    class Attribute < TreeNode
      include AgnosticBackend::Utilities

      attr_reader :name, :parent

      def initialize(name, parent:, context:)
        super([], context)
        @name, @parent = name, parent
      end

      def ==(o)
        super && o.name == name
      end

      def type
        value_for_key(context.index.schema, name).try(:type)
      end

      def any?
        @name == '*'
      end

      def score?
        @name == '_score'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
agnostic_backend-1.0.4 lib/agnostic_backend/queryable/attribute.rb
agnostic_backend-1.0.3 lib/agnostic_backend/queryable/attribute.rb
agnostic_backend-1.0.2 lib/agnostic_backend/queryable/attribute.rb
agnostic_backend-1.0.1 lib/agnostic_backend/queryable/attribute.rb