class ActionMessage::Message

Attributes

action[RW]
adapter[R]
args[RW]
body[RW]
debug[RW]
to[RW]

Public Class Methods

new() click to toggle source
# File lib/action_message/message.rb, line 8
def initialize
  @adapter = Adapters.adapter
end

Public Instance Methods

debug?() click to toggle source
# File lib/action_message/message.rb, line 12
def debug?
  !!@debug
end
deliver() click to toggle source
# File lib/action_message/message.rb, line 16
def deliver
  if debug?
    # TODO: add log
    return nil
  elsif Interceptor.registered_for?(self)
    # TODO: add log
    return nil   
  else
    # TODO: add logger 'Sending message from "number" to "number"'
    adapter.send_message(body, to: to)
  end
end