application_handle_info.rb 299 B

123456789101112131415
  1. module ApplicationHandleInfo
  2. def self.current
  3. Thread.current[:application_handle] || 'unknown'
  4. end
  5. def self.current=(name)
  6. Thread.current[:application_handle] = name
  7. end
  8. def self.postmaster?
  9. return false if current.blank?
  10. current.split('.')[1] == 'postmaster'
  11. end
  12. end