class Bullet::Notification::Base

def associations_str

def associations_str
  ".includes(#{@associations.map { |a| a.to_s.to_sym }
ct})"
end

def body

def body
  raise NoMethodError, 'no method body defined'
end

def body_with_caller

def body_with_caller
  "#{body}\n#{call_stack_messages}\n"
end

def call_stack_messages

def call_stack_messages
  ''
end

def eql?(other)

def eql?(other)
  self.class == other.class && klazz_associations_str == other.klazz_associations_str
end

def hash

def hash
  [self.class, klazz_associations_str].hash
end

def initialize(base_class, association_or_associations, path = nil)

def initialize(base_class, association_or_associations, path = nil)
  @base_class = base_class
  @associations =
    association_or_associations.is_a?(Array) ? association_or_associations : [association_or_associations]
  @path = path
end

def klazz_associations_str

def klazz_associations_str
  "  #{@base_class} => [#{@associations.map(&:inspect).join(', ')}]"
end

def notification_data

def notification_data
  hash = {}
  hash[:user] = whoami unless Bullet.skip_user_in_notification
  hash[:url] = url
  hash[:title] = title
  hash[:body] = body_with_caller
  hash
end

def notify_inline

def notify_inline
  notifier.inline_notify(notification_data)
end

def notify_out_of_channel

def notify_out_of_channel
  notifier.out_of_channel_notify(notification_data)
end

def short_notice

def short_notice
  parts = []
  parts << whoami.presence unless Bullet.skip_user_in_notification
  parts << url
  parts << title
  parts << body
  parts.compact.join('  ')
end

def title

def title
  raise NoMethodError, 'no method title defined'
end

def whoami

def whoami
  @user ||=
    ENV['USER'].presence ||
    (
      begin
        `whoami`.chomp
      rescue StandardError
        ''
      end
    )
  @user.present? ? "user: #{@user}" : ''
end