Class: Rpush::Deprecation

Inherits:
Object
  • Object
show all
Defined in:
lib/rpush/deprecation.rb

Class Method Summary collapse

Class Method Details

.mutedObject



3
4
5
6
7
8
9
# File 'lib/rpush/deprecation.rb', line 3

def self.muted
  orig_val = Thread.current[:rpush_mute_deprecations]
  Thread.current[:rpush_mute_deprecations] = true
  yield
ensure
  Thread.current[:rpush_mute_deprecations] = orig_val
end

.muted?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rpush/deprecation.rb', line 11

def self.muted?
  Thread.current[:rpush_mute_deprecations] == true
end

.warn(msg) ⇒ Object



15
16
17
18
# File 'lib/rpush/deprecation.rb', line 15

def self.warn(msg)
  return if Rpush::Deprecation.muted?
  STDERR.puts "DEPRECATION WARNING: #{msg}"
end