Class: MatrixQQ::Matrix
- Inherits:
-
Object
- Object
- MatrixQQ::Matrix
- Defined in:
- lib/matrix_qq/matrix/log.rb,
lib/matrix_qq/matrix/dbus.rb,
lib/matrix_qq/matrix/hack.rb,
lib/matrix_qq/matrix/send.rb,
lib/matrix_qq/matrix/matrix.rb,
lib/matrix_qq/matrix/forward/main.rb,
lib/matrix_qq/matrix/forward/group.rb
Defined Under Namespace
Modules: Hack, Send Classes: DBus, Forward, Log
Constant Summary collapse
- SIGN =
%i[ all account_data to_device presence rooms leave join invite device_lists changed left ].freeze
Instance Attribute Summary collapse
-
#dbus ⇒ Object
readonly
Returns the value of attribute dbus.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#qq_dbus ⇒ Object
Returns the value of attribute qq_dbus.
Instance Method Summary collapse
- #hack(i, info) ⇒ Object
-
#initialize(dbus) ⇒ Matrix
constructor
A new instance of Matrix.
- #reg ⇒ Object
Constructor Details
Instance Attribute Details
#dbus ⇒ Object (readonly)
Returns the value of attribute dbus.
22 23 24 |
# File 'lib/matrix_qq/matrix/matrix.rb', line 22 def dbus @dbus end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
22 23 24 |
# File 'lib/matrix_qq/matrix/matrix.rb', line 22 def info @info end |
#qq_dbus ⇒ Object
Returns the value of attribute qq_dbus.
23 24 25 |
# File 'lib/matrix_qq/matrix/matrix.rb', line 23 def qq_dbus @qq_dbus end |
Instance Method Details
#hack(i, info) ⇒ Object
43 44 45 46 |
# File 'lib/matrix_qq/matrix/matrix.rb', line 43 def hack(i, info) Hack.list.each { |h| info = h.call(@dbus, info, i) } info end |
#reg ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/matrix_qq/matrix/matrix.rb', line 30 def reg SIGN.each do |i| @dbus.obj.on_signal i.to_s do |json| info = hack i, JSON.parse(json) Matrix.send(i).each do |func| MatrixQQ.log(func.name) do func.new(@dbus, @qq_dbus, info.dup).run end end end end end |