Class: WeixinPublic::WeixinMessage

Inherits:
WeixinObject show all
Defined in:
lib/weixin_public.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from WeixinObject

#initialize

Constructor Details

This class inherits a constructor from WeixinPublic::WeixinObject

Instance Attribute Details

#contentObject

Returns the value of attribute content.



26
27
28
# File 'lib/weixin_public.rb', line 26

def content
  @content
end

#dateTimeObject

Returns the value of attribute dateTime.



26
27
28
# File 'lib/weixin_public.rb', line 26

def dateTime
  @dateTime
end

#fakeIdObject

Returns the value of attribute fakeId.



26
27
28
# File 'lib/weixin_public.rb', line 26

def fakeId
  @fakeId
end

#fileIdObject

Returns the value of attribute fileId.



26
27
28
# File 'lib/weixin_public.rb', line 26

def fileId
  @fileId
end

#hasReplyObject

Returns the value of attribute hasReply.



26
27
28
# File 'lib/weixin_public.rb', line 26

def hasReply
  @hasReply
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/weixin_public.rb', line 26

def id
  @id
end

#nickNameObject

Returns the value of attribute nickName.



26
27
28
# File 'lib/weixin_public.rb', line 26

def nickName
  @nickName
end

#remarkNameObject

Returns the value of attribute remarkName.



26
27
28
# File 'lib/weixin_public.rb', line 26

def remarkName
  @remarkName
end

#sourceObject

Returns the value of attribute source.



26
27
28
# File 'lib/weixin_public.rb', line 26

def source
  @source
end

#typeObject

Returns the value of attribute type.



26
27
28
# File 'lib/weixin_public.rb', line 26

def type
  @type
end

Instance Method Details

#filePathObject



28
29
30
31
# File 'lib/weixin_public.rb', line 28

def filePath
  file_type = {"2"=>"jpg","3"=>"mp3","4"=>"mp4"}[@type]
  "#{@id}.#{file_type}"
end

#fileTypeObject



33
34
35
# File 'lib/weixin_public.rb', line 33

def fileType
  filetype={"2"=>"image/jpg","3"=>"audio/mp3","4"=>"video/mp4"}[@type]
end