Module: Identifiable
- Included in:
- Selector
- Defined in:
- tomes/spells/identifiable.rb
Overview
This module imparts a class-level ID counter (as well as methods for manipulating said counter) and a class tag.
Instance Method Summary collapse
-
#id_counter ⇒ Integer
Returns the class ID counter.
-
#increment_id_counter ⇒ Void
Adds 1 to the ID counter.
-
#tag ⇒ String
Returns the class tag.
-
#tag=(tag) ⇒ Void
Assigns the class (and its descendants) a tag for the #id_tag method in Identity.
Instance Method Details
#id_counter ⇒ Integer
Returns the class ID counter.
24 25 26 |
# File 'tomes/spells/identifiable.rb', line 24 def id_counter @id_counter end |
#increment_id_counter ⇒ Void
Adds 1 to the ID counter.
11 12 13 |
# File 'tomes/spells/identifiable.rb', line 11 def increment_id_counter @id_counter += 1 end |
#tag ⇒ String
Returns the class tag.
30 31 32 |
# File 'tomes/spells/identifiable.rb', line 30 def tag @tag end |
#tag=(tag) ⇒ Void
Assigns the class (and its descendants) a tag for the #id_tag method in Identity.
18 19 20 |
# File 'tomes/spells/identifiable.rb', line 18 def tag=(tag) @tag = tag end |