Skip to content
Snippets Groups Projects
Commit 9de65b9c authored by Dominik Honnef's avatar Dominik Honnef
Browse files

Document how to correctly create Channel and User instances

Document that using Channel.new and User.new aren't the correct way of
obtaining instances of these classes, and that one should use
ChannelList and UserList instead.

Thanks to Simon Lundström for an attempted patch.

Closes gh-203
parent a2c024e9
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,9 @@ module Cinch
# @return [Hash{String => Object}]
attr_reader :modes
synced_attr_reader :modes
# @note Generally, you shouldn't initialize new instances of this
# class. Use {ChannelList#find_ensured} instead.
def initialize(name, bot)
@bot = bot
@name = name
......
......@@ -185,7 +185,8 @@ module Cinch
# @api private
attr_writer :monitored
# @note Generally, you shouldn't initialize new instances of this
# class. Use {UserList#find_ensured} instead.
def initialize(*args)
@data = {
:user => nil,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment