Module: MenuMaker::Path::Converter

Defined in:
lib/menu_maker/path.rb

Defined Under Namespace

Classes: ArrayConverter, GenericConverter, StringConverter

Class Method Summary collapse

Class Method Details

.convert(path) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/menu_maker/path.rb', line 32

def self.convert(path)
  type = path.class.name.to_s.split('::').last.to_s

  const_get("#{type}Converter").convert path
rescue NameError
  GenericConverter.convert path
end