Method: Hanami::Utils::Kernel.Pathname
- Defined in:
- lib/hanami/utils/kernel.rb
permalink .Pathname(arg) ⇒ Pathname
Coerces the argument to be a Pathname.
964 965 966 967 968 969 970 971 972 |
# File 'lib/hanami/utils/kernel.rb', line 964 def self.Pathname(arg) case arg when ->(a) { a.respond_to?(:to_pathname) } then arg.to_pathname else super end rescue NoMethodError raise TypeError.new "can't convert #{inspect_type_error(arg)}into Pathname" end |