Sha256: 698a16dc72ad7c3c4bc16a8d93e96e96c7a394592ce1a986bc8ace66115077cb

Contents?: true

Size: 638 Bytes

Versions: 2

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module PlainModel
  module Querying
    module Except
      extend ActiveSupport::Concern

      # Chain method
      # @param keys [Array<Symbol>] values keys that you want to exclude from query
      # @return new instance with applied changes
      def except(*keys)
        dup.except!(*keys)
      end

      # Chain method
      # @param keys [Array<Symbol>] values keys that you want to exclude from query
      # @return new instance with applied changes
      def except!(*keys)
        self.values = values.except(*keys)
        self
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plain_model-0.2.1 lib/plain_model/querying/except.rb
plain_model-0.2.0 lib/plain_model/querying/except.rb