Class: SimpleWx::Messages::VideoMessage
- Inherits:
-
SimpleWx::Message
- Object
- Base
- SimpleWx::Message
- SimpleWx::Messages::VideoMessage
- Defined in:
- lib/simple_wx/messages/video_message.rb
Instance Attribute Summary
Attributes inherited from SimpleWx::Message
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options) ⇒ VideoMessage
constructor
A new instance of VideoMessage.
- #send_json ⇒ Object
- #to_xml ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options) ⇒ VideoMessage
Returns a new instance of VideoMessage.
4 5 6 7 |
# File 'lib/simple_wx/messages/video_message.rb', line 4 def initialize super @video = [:video] end |
Instance Method Details
#send_json ⇒ Object
9 10 11 12 13 14 |
# File 'lib/simple_wx/messages/video_message.rb', line 9 def send_json @json[:msgtype] = "video" @json[:video] = @video SimpleWx.logger.info("SimpleWxLog:#{self.class.name} -- #{@openid} -- #{json}") super end |
#to_xml ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_wx/messages/video_message.rb', line 16 def to_xml @xml["MsgType"] = "video" @xml["Video"] = { "MediaId" => @video[:media_id], "Title" => @video[:title], "Description" => @video[:description], } super end |