Grape.Taggable Class
A taggable class. If you add a tag to an instance, you can get it from the container.
Constructor
Grape.Taggable
()
Item Index
Methods
addTag
(
Boolean
-
name
Adds a tag to a taggable object.
Parameters:
-
name
StringTag name
Returns:
Boolean:
true, if a new tag is added, false, if the tag was already added.
hasTag
(
Boolean
-
name
Checks if a tag is added or not.
Parameters:
-
name
StringTag name
Returns:
Boolean:
true, if the instance has the tag
removeTag
(
-
name
Removes a tag from a taggable object. If the tag is not added, does nothing.
Parameters:
-
name
StringTag name
removeTagContainer
()
Detaches the TagContainer. The instance is no more queryable through the container.
setTagContainer
(
-
container
Sets the tag container for the instance. If tags are added already, they will appear in the new container. If the instance already has a tagContainer, it will be removed first.
Parameters:
-
container
TagContainerThe container