class MenuMaker::Path::Converter::GenericConverter

Public Class Methods

convert(path) click to toggle source
# File lib/menu_maker/path.rb, line 58
def self.convert(path)
  unless respond_to_protocol?(path)
    fail PathError, "Don't know how to create path with #{path}"
  end

  Path.new path.method, path.path
end
respond_to_protocol?(path) click to toggle source
# File lib/menu_maker/path.rb, line 66
def self.respond_to_protocol?(path)
  path.respond_to?(:path) && path.respond_to?(:method)
end