Module: ConfigMapper::Validator

Defined in:
lib/config_mapper/validator.rb

Class Method Summary collapse

Class Method Details

.resolve(arg) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/config_mapper/validator.rb', line 7

def self.resolve(arg)
  return arg if arg.respond_to?(:call)
  if arg.respond_to?(:name)
    # looks like a primitive class -- find the corresponding coercion method
    return Kernel.method(arg.name)
  end

  arg
end