Class: Nanoc::Core::MutableIdentifiableCollectionView

Inherits:
IdentifiableCollectionView show all
Defined in:
lib/nanoc/core/mutable_identifiable_collection_view.rb

Constant Summary

Constants inherited from IdentifiableCollectionView

IdentifiableCollectionView::NOTHING

Instance Method Summary collapse

Methods inherited from IdentifiableCollectionView

#[], #_unwrap, #each, #find_all, #initialize, #size, #view_class

Methods inherited from View

#_context, #_unwrap, #frozen?, #initialize, #inspect

Methods included from ContractsSupport

enabled?, included, setup_once, warn_about_performance

Constructor Details

This class inherits a constructor from Nanoc::Core::IdentifiableCollectionView

Instance Method Details

#delete_if {|object| ... } ⇒ self

Deletes every object for which the block evaluates to true.

Yield Parameters:

  • object (#identifier)

Yield Returns:

  • (Boolean)

Returns:

  • (self)


13
14
15
16
# File 'lib/nanoc/core/mutable_identifiable_collection_view.rb', line 13

def delete_if(&_block)
  @objects = @objects.reject { |o| yield(view_class.new(o, @context)) }
  self
end