Class: Ferret::Browser::Controller
- Inherits:
-
Object
- Object
- Ferret::Browser::Controller
- Includes:
- ViewHelper
- Defined in:
- lib/ferret/browser.rb
Direct Known Subclasses
DocumentController, ErrorController, HelpController, HomeController, TermController, TermVectorController
Constant Summary collapse
- APP_DIR =
File.(File.join(File.dirname(__FILE__), "browser/"))
- STATIC_DIR =
File.(File.join(APP_DIR, "s/"))
Instance Method Summary collapse
-
#initialize(reader, path, vars) ⇒ Controller
constructor
A new instance of Controller.
- #method_missing(meth_id, *args) ⇒ Object
Methods included from ViewHelper
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 |