class Maia::Message

Public Instance Methods

background?() click to toggle source
# File lib/maia/message.rb, line 8
def background?; end
badge() click to toggle source
# File lib/maia/message.rb, line 6
def badge; end
body() click to toggle source
# File lib/maia/message.rb, line 4
def body;  end
color() click to toggle source
# File lib/maia/message.rb, line 7
def color; end
data() click to toggle source
# File lib/maia/message.rb, line 11
def data
  {}
end
image() click to toggle source
# File lib/maia/message.rb, line 5
def image; end
priority() click to toggle source
# File lib/maia/message.rb, line 9
def priority; end
send_to(*models, topic: nil, token: nil, messenger: Maia.messenger) click to toggle source
# File lib/maia/message.rb, line 27
def send_to(*models, topic: nil, token: nil, messenger: Maia.messenger)
  targets = []
  targets << Maia::Topic.new(topic) if topic
  targets << Maia::Token.new(token) if token

  Maia::Devices.new(models).each do |t|
    targets << t
  end

  targets.map do |target|
    messenger.deliver Maia.gateway.serialize(self, target)
  end
end
sound() click to toggle source
# File lib/maia/message.rb, line 15
def sound
  'default'
end
targeting(target) click to toggle source
# File lib/maia/message.rb, line 19
def targeting(target)
  tap { @target = target }
end
title() click to toggle source
# File lib/maia/message.rb, line 3
def title; end
to_json() click to toggle source
# File lib/maia/message.rb, line 23
def to_json
  to_h.to_json
end