Sha256: 934873361a26b8dc0aabad7305b487f3ee3426532c7b5d7c80d746502a591f26

Contents?: true

Size: 427 Bytes

Versions: 53

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  class MutableIdentifiableCollectionView < Nanoc::IdentifiableCollectionView
    # Deletes every object for which the block evaluates to true.
    #
    # @yieldparam [#identifier] object
    #
    # @yieldreturn [Boolean]
    #
    # @return [self]
    def delete_if(&_block)
      @objects = @objects.reject { |o| yield(view_class.new(o, @context)) }
      self
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
nanoc-4.11.12 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.11 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.10 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.9 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.8 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.7 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.6 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.5 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.4 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.3 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.2 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.1 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.11.0 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.10.4 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.10.3 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.10.2 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.10.1 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.10.0 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.9.9 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.9.8 lib/nanoc/base/views/mutable_identifiable_collection_view.rb