Class: Wechat::Message::Mass

Inherits:
Base
  • Object
show all
Defined in:
app/apis/wechat/message/mass.rb

Direct Known Subclasses

Public, Work

Defined Under Namespace

Classes: Public, Work

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#content_blank?

Constructor Details

#initialize(app, msg = {}) ⇒ Mass

Returns a new instance of Mass.



4
5
6
7
8
9
# File 'app/apis/wechat/message/mass.rb', line 4

def initialize(app, msg = {})
  super
  @send_to = nil
  @msgtype = @message_hash['msgtype'].to_s
  restore
end

Instance Attribute Details

#msgtypeObject (readonly)

Returns the value of attribute msgtype.



2
3
4
# File 'app/apis/wechat/message/mass.rb', line 2

def msgtype
  @msgtype
end

Instance Method Details

#do_sendObject



11
12
13
# File 'app/apis/wechat/message/mass.rb', line 11

def do_send

end

#restoreObject



15
16
17
18
19
20
# File 'app/apis/wechat/message/mass.rb', line 15

def restore
  case msgtype
  when 'text', 'markdown'
    @message_hash[msgtype] = { content: @message_hash.delete('content') }
  end
end