From 882dde0610ddce397e7dec37cfcaf0625466524c Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 20 Nov 2015 21:05:55 +0000 Subject: [PATCH] Equality docs --- docs/docs_equality.rst | 20 ++++++++++++++++++++ docs/index.rst | 2 ++ docs/vars.rst | 2 ++ 3 files changed, 24 insertions(+) create mode 100644 docs/docs_equality.rst diff --git a/docs/docs_equality.rst b/docs/docs_equality.rst new file mode 100644 index 000000000..d0da288c9 --- /dev/null +++ b/docs/docs_equality.rst @@ -0,0 +1,20 @@ +.. include:: ./vars.rst + +Equality +======== + +The Equality class is used to see if two objects are equal, based on ``object_1.id === object_2.id``. + +If any class in Discord extends equality, it means you should never the default equality operands (``==`` & ``===``) as they could potentially be different instances and therefore appear not to be equal. Instead, use ``equalityObject.equals()`` as shown below. + +Functions +--------- + +-------- + +equals(object) +~~~~~~~~~~~~~~ + +Returns true if the specified object is the same as this one. + +- **object** - Any `object` with an ``id`` property. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 198dc4c24..ef61dfab8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,12 +37,14 @@ Contents: docs_server docs_user docs_message + docs_invite .. toctree:: :maxdepth: 2 :caption: Util Documentation docs_cache + docs_equality Indices and tables diff --git a/docs/vars.rst b/docs/vars.rst index 153134e31..7de256f44 100644 --- a/docs/vars.rst +++ b/docs/vars.rst @@ -8,5 +8,7 @@ .. _VoiceChannel : ./docs_voicechannel.html .. _PMChannel : ./docs_pmchannel.html .. _Message : ./docs_message.html +.. _Invite : ./docs_invite.html +.. _Equality : ./docs_equality.html .. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise .. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter \ No newline at end of file