Class: OPQ::Msg
- Inherits:
-
Object
- Object
- OPQ::Msg
- Defined in:
- lib/opqr/struct.rb
Instance Attribute Summary collapse
-
#from_uin ⇒ Object
Returns the value of attribute from_uin.
-
#msg_type ⇒ Object
Returns the value of attribute msg_type.
-
#raw_json ⇒ Object
Returns the value of attribute raw_json.
-
#sender_uin ⇒ Object
Returns the value of attribute sender_uin.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(msg) ⇒ Msg
constructor
A new instance of Msg.
Constructor Details
#initialize(msg) ⇒ Msg
Returns a new instance of Msg.
4 5 6 7 8 9 10 11 |
# File 'lib/opqr/struct.rb', line 4 def initialize(msg) @type = msg['CurrentPacket']['EventData']['MsgHead']['FromType'] @from_uin = msg['CurrentPacket']['EventData']['MsgHead']['FromUin'] @sender_uin = msg['CurrentPacket']['EventData']['MsgHead']['SenderUin'] @text = msg['CurrentPacket']['EventData']['MsgBody']['Content'] @msg_type = msg['CurrentPacket']['EventData']['MsgHead']['MsgType'] @raw_json = msg end |
Instance Attribute Details
#from_uin ⇒ Object
Returns the value of attribute from_uin.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def from_uin @from_uin end |
#msg_type ⇒ Object
Returns the value of attribute msg_type.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def msg_type @msg_type end |
#raw_json ⇒ Object
Returns the value of attribute raw_json.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def raw_json @raw_json end |
#sender_uin ⇒ Object
Returns the value of attribute sender_uin.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def sender_uin @sender_uin end |
#text ⇒ Object
Returns the value of attribute text.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/opqr/struct.rb', line 12 def type @type end |