Sha256: f515af4f26454c3d9bbfad1979988ccdfa03f298b1876968baa4bfada7724187

Contents?: true

Size: 885 Bytes

Versions: 5

Compression:

Stored size: 885 Bytes

Contents

require 'xing-backend'
require 'active_support/deprecation'

module Xing
  DEPRECATED_CLASSES = {
    :HypermediaJSONMapper      => Xing::Mappers::Base,
    :BaseSerializer            => Xing::Serializers::Base,
    :ResourcesSerializer       => Xing::Serializers::RootResources,
    :JsonTreeLister            => Xing::Services::JsonTreeLister,
    :ActiveModelErrorConverter => Xing::Services::ErrorConverter,
    :RemoteSnapshotFetcher     => Xing::Services::SnapshotFetcher
  }
end

#Xing::DEPRECATED_CLASSES.each do |old, new|

  ## with great power comes great responsibility
  #Object.const_set(old, ActiveSupport::Deprecation::DeprecatedConstantProxy.new(old, new))
#end

def Object.const_missing(name)
  if (klass = ::Xing::DEPRECATED_CLASSES[name.to_sym])
    warn "[DEPRECATION] #{name} is deprecated. Please use #{klass.to_s} instead."
    klass
  else
    super
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xing-backend-0.0.17 lib/deprecated_classes.rb
xing-backend-0.0.13 lib/deprecated_classes.rb
xing-backend-0.0.12 lib/deprecated_classes.rb
xing-backend-0.0.11 lib/deprecated_classes.rb
xing-backend-0.0.10 lib/deprecated_classes.rb