Sha256: b2efa77385bc1308876212afd4d7fb0fcf911816fa4dae987101dc4258f858e0

Contents?: true

Size: 302 Bytes

Versions: 3

Compression:

Stored size: 302 Bytes

Contents

module ConfigMapper

  module Validator

    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

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
config_mapper-1.7.0 lib/config_mapper/validator.rb
config_mapper-1.6.0 lib/config_mapper/validator.rb
config_mapper-1.5.0 lib/config_mapper/validator.rb