class DingBot::Message::Text

text类型 {

"msgtype": "text",
"text": {
    "content": "我就是我, 是不一样的烟火"
},
"at": {
    "atMobiles": [
        "156xxxx8827",
        "189xxxx8325"
    ],
    "isAtAll": false
}

}

Attributes

at_mobiles[RW]
content[RW]
is_at_all[RW]

Public Class Methods

new(content='', at_mobiles=[], is_at_all=false) click to toggle source
# File lib/dingbot/message/text.rb, line 21
def initialize(content='', at_mobiles=[], is_at_all=false)
  @content = content
  @at_mobiles = at_mobiles
  @is_at_all = is_at_all
end

Public Instance Methods

body_params() click to toggle source
Calls superclass method DingBot::Message::Base#body_params
# File lib/dingbot/message/text.rb, line 31
def body_params
  super.merge(
      {
          text: {
              content: @content
          },
          at: {
              atMobiles: @at_mobiles,
              isAtAll: @is_at_all
          }
      }
  )
end
msg_type() click to toggle source
# File lib/dingbot/message/text.rb, line 27
def msg_type
  TYPE::TEXT
end