class Notificate::Notice

Public Class Methods

new(message, message_type) click to toggle source
# File lib/notificate/notice.rb, line 4
def initialize(message, message_type)
  @defaults = { headers: { 'Content-Type' => 'application/json'} }

  case message_type
  when :application
    app_notice(message)
  when :exception
    exception_notice(message)
  end
end

Public Instance Methods

app_notice(payload) click to toggle source
# File lib/notificate/notice.rb, line 15
def app_notice(payload)
  self.class.post(Notificate.request_path, payload.merge(@defaults))
end
exception_notice(payload) click to toggle source
# File lib/notificate/notice.rb, line 19
def exception_notice(payload)
  self.class.post(Notificate.request_path, payload.merge(@defaults))
end