Sha256: 80e34617f10e6bfb3a08d855ec6fbf3eb14974f5011dd80cf2d99a4bc58c1467

Contents?: true

Size: 669 Bytes

Versions: 18

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

module Mongoid

  # This module contains all the behavior for Ruby implementations of MongoDB
  # selectors.
  module Matchable
    extend ActiveSupport::Concern

    # Determines if this document has the attributes to match the supplied
    # MongoDB selector. Used for matching on embedded associations.
    #
    # @example Does the document match?
    #   document._matches?(:title => { "$in" => [ "test" ] })
    #
    # @param [ Hash ] selector The MongoDB selector.
    #
    # @return [ true | false ] True if matches, false if not.
    def _matches?(selector)
      Matcher::Expression.matches?(self, selector)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mongoid-8.1.9 lib/mongoid/matchable.rb
mongoid-8.0.9 lib/mongoid/matchable.rb
mongoid-8.1.8 lib/mongoid/matchable.rb
mongoid-8.1.7 lib/mongoid/matchable.rb
mongoid-8.1.6 lib/mongoid/matchable.rb
mongoid-8.0.8 lib/mongoid/matchable.rb
mongoid-8.1.5 lib/mongoid/matchable.rb
mongoid-8.1.4 lib/mongoid/matchable.rb
mongoid-8.0.7 lib/mongoid/matchable.rb
mongoid-8.1.3 lib/mongoid/matchable.rb
mongoid-8.1.2 lib/mongoid/matchable.rb
mongoid-8.0.6 lib/mongoid/matchable.rb
mongoid-8.1.1 lib/mongoid/matchable.rb
mongoid-8.0.5 lib/mongoid/matchable.rb
mongoid-8.1.0 lib/mongoid/matchable.rb
mongoid-8.0.4 lib/mongoid/matchable.rb
mongoid-8.0.3 lib/mongoid/matchable.rb
mongoid-8.0.2 lib/mongoid/matchable.rb