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

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



55
56
57
# File 'tomes/spells/identifiable.rb', line 55

def id
  @id
end

Instance Method Details

#id_tagObject

A string with the class tag and instance ID number.

Returns:

  • String



59
60
61
# File 'tomes/spells/identifiable.rb', line 59

def id_tag
  format('%s%02d', this_class.tag, id)
end