Module inheritance

I’m trying to modify a module but I can’t seem to access it’s private
functions. This is for a rails app but I can’t find the help I’m
looking for on the rails list and it’s more of a ruby question than a
rails question. I’ll list my code and then the error.

module ActionController::Caching::Pages
include ClassMethods

Expires the page that was cached with the +path+ as a key. Example:

expire_page “/lists/show”
def expire_each_page(path)
return unless perform_caching
logger.error(“EXPIRED ALL PAGES: #{path}”)
File.delete(page_cache_path(path)) if
Dir.foreach(page_cache_path(path)) {|x| benchmark ("Got " + x) }

def page_cache_file(path)
name = ((path.empty? || path == “/”) ? “/index” :
name << page_cache_extension unless (name.split(’/’).last ||
name).include? ‘.’
return name

def page_cache_path(path)
  page_cache_directory + page_cache_file(path)


The two private methods are copied directly out of the file I’m trying
to modify. I don’t want to copy these methods into my plugin. If I
leave out the private methods, rails quits and complains about not being
able to find these methods. I just want to inherit them. Can you
inherit private methods? The file I’m trying to inherit from can be
viewed at.

Thanks in advance for any help!

Charlie B.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs