Class: Weixin::LocationMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/weixin/model.rb

Overview

<xml>

<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1351776360</CreateTime>
<MsgType><![CDATA[location]]></MsgType>
<Location_X>23.134521</Location_X>
<Location_Y>113.358803</Location_Y>
<Scale>20</Scale>
<Label><![CDATA[位置信息]]></Label>
<MsgId>1234567890123456</MsgId>

</xml>

Instance Method Summary collapse

Methods inherited from Message

#CreateTime, #MsgId, factory, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Weixin::Message

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Weixin::Message

Instance Method Details

#Location_XObject



105
106
107
# File 'lib/weixin/model.rb', line 105

def Location_X
    @source.Location_X.to_f
end

#Location_YObject



109
110
111
# File 'lib/weixin/model.rb', line 109

def Location_Y
    @source.Location_Y.to_f
end

#ScaleObject



113
114
115
# File 'lib/weixin/model.rb', line 113

def Scale
    @source.Scale.to_i
end