module Partializer::PathHelper

Public Instance Methods

build_path(path) click to toggle source
# File lib/partializer/path_helper.rb, line 8
def build_path path
  raise ArgumentError, "Must take a path argument" unless path
  File.join(to_partial_path, path.to_s.gsub('.', '/'))
end
partial_path(name) click to toggle source
# File lib/partializer/path_helper.rb, line 3
def partial_path name
  return File.join(to_partial_path, name.to_s) if partials.include? name.to_sym
  raise Partializer::InvalidPartialError, "the partial #{name} is not registered for this Partializer"
end