Skip to content
Browse files

improve documentation of Cinch::User

  • Loading branch information...
1 parent dead589 commit cfe1050975f2488f9175e2478138df4dc290f910 @dominikh dominikh committed
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/cinch/user.rb
View
12 lib/cinch/user.rb
@@ -138,12 +138,12 @@ def secure
# By default, you can use methods like User#user, User#host and
# alike – If you however fear that another thread might change
# data while you're using it and if this means a critical issue to
- # your code, you can store the result of this method and work with
- # that instead.
+ # your code, you can store a clone of the result of this method
+ # and work with that instead.
#
# @example
- # on :channel do
- # data = user.data
+ # on :channel do |m|
+ # data = m.user.data.dup
# do_something_with(data.user)
# do_something_with(data.host)
# end
@@ -269,6 +269,8 @@ def unsync_all
super
end
+ # @group Sending messages
+
# Send a message to the user.
#
# @param [String] message the message
@@ -348,6 +350,8 @@ def safe_action(message)
@bot.safe_action(@name, message)
end
+ # @endgroup
+
# @return [String]
def to_s
@nick

0 comments on commit cfe1050

Please sign in to comment.
Something went wrong with that request. Please try again.