refactor(command): 'clear' logic refactor
This commit is contained in:
@@ -12,7 +12,6 @@ class Clear(
|
|||||||
override val description = "clear colletion"
|
override val description = "clear colletion"
|
||||||
|
|
||||||
override fun execute(args: String) {
|
override fun execute(args: String) {
|
||||||
collectionManager.getCollection().clear()
|
collectionManager.clear()
|
||||||
io.println(collectionManager.getCollection().toString())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,8 @@ class CollectionManager(
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
fun getCollection(): LinkedList<Product> = list
|
fun getCollection(): LinkedList<Product> = list
|
||||||
|
|
||||||
|
fun clear() {
|
||||||
|
list.clear()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user