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

Instance Method Summary collapse

Instance Attribute Details

#idString (readonly) Also known as: resolve_id, hash


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