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



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

def raise_on_deprecation
  @raise_on_deprecation
end

Instance Method Details

#deprecation(message) ⇒ Object



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

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