Class: MatrixQQ::QQ::ForwardFriend::Matrix
- Inherits:
-
Object
- Object
- MatrixQQ::QQ::ForwardFriend::Matrix
- Defined in:
- lib/matrix_qq/qq/forward_friend/matrix.rb
Instance Method Summary collapse
-
#initialize(dbus, matrix, info, room) ⇒ Matrix
constructor
A new instance of Matrix.
- #message(messages) ⇒ Object
- #run ⇒ Object
- #user(user) ⇒ Object
Constructor Details
#initialize(dbus, matrix, info, room) ⇒ Matrix
Returns a new instance of Matrix.
5 6 7 8 9 10 |
# File 'lib/matrix_qq/qq/forward_friend/matrix.rb', line 5 def initialize(dbus, matrix, info, room) @dbus = dbus @info = info @matrix = matrix @room = room end |
Instance Method Details
#message(messages) ⇒ Object
20 21 22 23 24 |
# File 'lib/matrix_qq/qq/forward_friend/matrix.rb', line 20 def () .inject('') do |obj, msg| obj + QQ.cq_call(msg) end end |
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/matrix_qq/qq/forward_friend/matrix.rb', line 12 def run msg = @info['message'] sender = "[#{user @info['user_id']}] " if @info['print_sender'] MatrixQQ::Matrix::Send.text \ @matrix, @room, "#{sender}#{msg}" end |
#user(user) ⇒ Object
26 27 28 |
# File 'lib/matrix_qq/qq/forward_friend/matrix.rb', line 26 def user(user) @dbus.get_stranger_info(user_id: user)['nickname'] end |