API Docs for: 1.0.1

Grape.Taggable Class

A taggable class. If you add a tag to an instance, you can get it from the container.

Constructor

Grape.Taggable

()

Methods

addTag

(
  • name
)
Boolean

Adds a tag to a taggable object.

Parameters:

  • name String

    Tag name

Returns:

Boolean:

true, if a new tag is added, false, if the tag was already added.

hasTag

(
  • name
)
Boolean

Checks if a tag is added or not.

Parameters:

  • name String

    Tag 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 String

    Tag 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 TagContainer

    The container