Class: Ferret::Browser::Controller

Inherits:
Object
  • Object
show all
Includes:
ViewHelper
Defined in:
lib/ferret/browser.rb

Constant Summary collapse

APP_DIR =
File.expand_path(File.join(File.dirname(__FILE__), "browser/"))
STATIC_DIR =
File.expand_path(File.join(APP_DIR, "s/"))

Instance Method Summary collapse

Methods included from ViewHelper

#tick_or_cross, #truncate

Constructor Details

#initialize(reader, path, vars) ⇒ Controller

Returns a new instance of Controller.



89
90
91
92
93
94
# File 'lib/ferret/browser.rb', line 89

def initialize(reader, path, vars)
  @reader = reader
  @path = path
  vars.each_pair {|key, val| instance_eval("@#{key} = val")}
  @controller_path = pathify(self.class.to_s.gsub(/.*:/, ''))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth_id, *args) ⇒ Object



96
97
98
# File 'lib/ferret/browser.rb', line 96

def method_missing(meth_id, *args)
  render(:action => meth_id)
end