Module: Dry::Validation::Deprecations

Extended by:
Configurable
Included in:
Schema::DSL, Schema::Rule
Defined in:
lib/dry/validation/deprecations.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.format(msg, caller) ⇒ Object



10
11
12
# File 'lib/dry/validation/deprecations.rb', line 10

def self.format(msg, caller)
  "#{msg} [#{caller[1].split(':')[0..1].join(' line ')}]"
end

Instance Method Details

#loggerObject



14
15
16
# File 'lib/dry/validation/deprecations.rb', line 14

def logger
  @logger ||= Deprecations.config.logger
end

#warn(msg) ⇒ Object



18
19
20
# File 'lib/dry/validation/deprecations.rb', line 18

def warn(msg)
  logger.warn(Deprecations.format(msg, ::Kernel.caller))
end