Module: LunchMoney::Deprecate

Defined in:
lib/lunchmoney/deprecate.rb

Instance Method Summary collapse

Instance Method Details

#deprecate_endpoint(replacement = nil) ⇒ void

This method returns an undefined value.

Parameters:

  • replacement (String, nil) (defaults to: nil)


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lunchmoney/deprecate.rb', line 9

def deprecate_endpoint(replacement = nil)
  return unless endpoint_deprecation_warnings

  replacement = if replacement.nil?
    "There is currently no replacement for this endpoint"
  else
    "Please use #{replacement} instead"
  end

  message = "#{deprecated_endpoint} is deprecated and may be removed from LunchMoney | #{replacement}"
  Kernel.warn(message)
end