class Getui::Message

Attributes

is_offline[RW]
message_type[RW]
offline_expire_time[RW]
push_info[RW]
push_network_type[RW]
transmission_content[RW]
transmission_type[RW]

Public Class Methods

new(message_type, is_offline: true, offline_expire_time: 7 * 24 * 60 * 60, push_network_type: 0) click to toggle source
# File lib/getui/message.rb, line 4
def initialize(message_type, is_offline: true, offline_expire_time: 7 * 24 * 60 * 60, push_network_type: 0)
  @transmission_type = 0
  @transmission_content = ""
  @message_type = message_type
  @is_offline = is_offline
  @offline_expire_time = offline_expire_time
  @push_network_type = push_network_type
end

Public Instance Methods

as_json() click to toggle source
# File lib/getui/message.rb, line 13
def as_json
  {
   appkey: Getui.app_key,
   is_offline: self.is_offline,
   offline_expire_time: self.offline_expire_time,
   push_network_type: self.push_network_type,
   msgtype: message_type,
  }
end