Module: Ecoportal::API::Common::Content::CollectionModel::Mutation::Clear

Extended by:
Includer
Defined in:
lib/ecoportal/api/common/content/collection_model/mutation/clear.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Includer

include_missing

Class Method Details

.included(base) ⇒ Object



11
12
13
14
15
# File 'lib/ecoportal/api/common/content/collection_model/mutation/clear.rb', line 11

def included(base)
  super
  include_missing(base, CollectionModel::Model::Iterable)
  include_missing(base, Mutation::Delete)
end

Instance Method Details

#clearObject

Deletes all the elements of this CollectionModel instance



21
22
23
# File 'lib/ecoportal/api/common/content/collection_model/mutation/clear.rb', line 21

def clear
  to_a.each {|item| delete!(item)}
end