Module: Opal::Deprecations

Included in:
Opal
Defined in:
opal/lib/opal/deprecations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raise_on_deprecationObject

Returns the value of attribute raise_on_deprecation



4
5
6
# File 'opal/lib/opal/deprecations.rb', line 4

def raise_on_deprecation
  @raise_on_deprecation
end

Instance Method Details

#deprecation(message) ⇒ Object



6
7
8
9
10
11
12
13
# File 'opal/lib/opal/deprecations.rb', line 6

def deprecation message
  message = "DEPRECATION WARNING: #{message}"
  if defined?(@raise_on_deprecation) && @raise_on_deprecation
    raise message
  else
    warn message
  end
end