Sha256: 1d657914d664f90687760017a61a3f449c2165001b9610f8920959ee2a0f4bda

Contents?: true

Size: 396 Bytes

Versions: 13

Compression:

Stored size: 396 Bytes

Contents

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

13 entries across 13 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.8 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.7 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.6 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.5 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.4 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.3 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.2 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.1 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.7.0 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.6.4 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.6.3 lib/nanoc/base/views/mutable_identifiable_collection_view.rb
nanoc-4.6.2 lib/nanoc/base/views/mutable_identifiable_collection_view.rb