Module: WeebSh::IDObject
- Included in:
- PreviewImage, ReputationSettings, ShimakazeBot, User
- Defined in:
- lib/weeb/data.rb
Overview
Mixin for objects with IDs
Instance Attribute Summary collapse
-
#id ⇒ String
(also: #resolve_id, #hash)
readonly
The ID which uniquely identifies this object in toph.
Instance Method Summary collapse
-
#==(other) ⇒ Object
ID based comparison.
Instance Attribute Details
#id ⇒ String (readonly) Also known as: resolve_id, hash
Returns the ID which uniquely identifies this object in toph.
8 9 10 |
# File 'lib/weeb/data.rb', line 8 def id @id end |
Instance Method Details
#==(other) ⇒ Object
ID based comparison
13 14 15 |
# File 'lib/weeb/data.rb', line 13 def ==(other) other.respond_to?(:resolve_id) ? (@id.resolve_id == other.resolve_id) : (@id == other) end |