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
-
#clear ⇒ Object
Deletes all the elements of this
CollectionModelinstance.
Methods included from Includer
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
#clear ⇒ Object
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 |