Module: Identity
- Included in:
- Selector
- Defined in:
- tomes/spells/identifiable.rb
Overview
This module includes methods for giving an Identifiable class instance its own ID attribute and a full ID Tag.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#id_tag ⇒ Object
A string with the class tag and instance ID number.
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
55 56 57 |
# File 'tomes/spells/identifiable.rb', line 55 def id @id end |
Instance Method Details
#id_tag ⇒ Object
A string with the class tag and instance ID number.
59 60 61 |
# File 'tomes/spells/identifiable.rb', line 59 def id_tag format('%s%02d', this_class.tag, id) end |