Module: GdsApi::TestHelpers::AliasDeprecated
- Included in:
- AssetManager, Calendars, ContentStore, Imminence, LicenceApplication, LinkCheckerApi, LocalLinksManager, Mapit, Organisations, PublishingApi, Support, SupportApi, Worldwide
- Defined in:
- lib/gds_api/test_helpers/alias_deprecated.rb
Instance Method Summary collapse
Instance Method Details
#alias_deprecated(deprecated_method, replacement_method) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/gds_api/test_helpers/alias_deprecated.rb', line 4 def alias_deprecated(deprecated_method, replacement_method) class_name = self.name define_method(deprecated_method) do |*args, &block| warn "##{deprecated_method} is deprecated on #{class_name} and will be removed in a future version. Use ##{replacement_method} instead" public_send(replacement_method, *args, &block) end end |