Method: ALib::Util::Casting#pathname_cast

Defined in:
lib/alib-0.5.0/util.rb

#pathname_cast(arg, opts = {}) ⇒ Object



1551
1552
1553
1554
1555
# File 'lib/alib-0.5.0/util.rb', line 1551

def pathname_cast arg, opts = {}
  expand = opts['expand'] || opts[:expand]
  pn = (Pathname === arg ? arg : Pathname.new(arg.to_s))
  expand ? pn.expand_path : pn 
end