Module: Koala::Utils

Extended by:
Forwardable, Utils
Included in:
Utils
Defined in:
lib/koala/utils.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

The Koala logger, an instance of the standard Ruby logger, pointing to STDOUT by default. In Rails projects, you can set this to Rails.logger.



15
16
17
# File 'lib/koala/utils.rb', line 15

def logger
  @logger
end

Instance Method Details

#deprecate(message) ⇒ Object

Prints a deprecation message. Each individual message will only be printed once to avoid spamming.



24
25
26
27
28
29
30
31
# File 'lib/koala/utils.rb', line 24

def deprecate(message)
  @posted_deprecations ||= []
  unless @posted_deprecations.include?(message)
    # only include each message once
    Kernel.warn("#{DEPRECATION_PREFIX}#{message}")
    @posted_deprecations << message
  end
end