Class: Intranet::AbstractResponder
- Inherits:
-
Object
- Object
- Intranet::AbstractResponder
- Defined in:
- lib/intranet/abstract_responder.rb
Overview
The default implementation and interface of an Intranet module.
Class Method Summary collapse
-
.module_homepage ⇒ String/Nil
The homepage of the module, if any.
-
.module_name ⇒ String
Returns the name of the module.
-
.module_version ⇒ String
The version of the module, according to semantic versionning.
Instance Method Summary collapse
-
#css_dependencies ⇒ Array
Provides the list of Cascade Style Sheets (CSS) dependencies for this module, either using absolute or relative (from the module root) paths.
-
#finalize ⇒ Object
Destroys the responder instance.
-
#generate_page(path, query) ⇒ Array
Generates the HTML content associated to the given
path
andquery
. -
#in_menu? ⇒ Boolean
Specifies if the responder instance should be displayed in the main navigation menu or not.
-
#js_dependencies ⇒ Array
Provides the list of Javascript files (JS) dependencies for this module, either using absolute or relative (from the module root) paths.
-
#resources_dir ⇒ String
Specifies the absolute path to the resources directory for that module.
Class Method Details
.module_homepage ⇒ String/Nil
The homepage of the module, if any.
16 |
# File 'lib/intranet/abstract_responder.rb', line 16 def self.module_homepage; end |
.module_name ⇒ String
Returns the name of the module.
8 |
# File 'lib/intranet/abstract_responder.rb', line 8 def self.module_name; end |
.module_version ⇒ String
The version of the module, according to semantic versionning.
12 |
# File 'lib/intranet/abstract_responder.rb', line 12 def self.module_version; end |
Instance Method Details
#css_dependencies ⇒ Array
Provides the list of Cascade Style Sheets (CSS) dependencies for this module, either using absolute or relative (from the module root) paths. If redefined, this method should probably append dependencies rather than overwriting them.
53 54 55 |
# File 'lib/intranet/abstract_responder.rb', line 53 def css_dependencies ['/design/style.css'] end |
#finalize ⇒ Object
Destroys the responder instance. This method gets called when server is shut down.
36 37 38 |
# File 'lib/intranet/abstract_responder.rb', line 36 def finalize # nothing to do end |
#generate_page(path, query) ⇒ Array
Generates the HTML content associated to the given path
and query
.
44 45 46 |
# File 'lib/intranet/abstract_responder.rb', line 44 def generate_page(path, query) [404, '', ''] end |
#in_menu? ⇒ Boolean
Specifies if the responder instance should be displayed in the main navigation menu or not.
21 22 23 |
# File 'lib/intranet/abstract_responder.rb', line 21 def true end |
#js_dependencies ⇒ Array
Provides the list of Javascript files (JS) dependencies for this module, either using absolute or relative (from the module root) paths. If redefined, this method should probably append dependencies rather than overwriting them.
62 63 64 |
# File 'lib/intranet/abstract_responder.rb', line 62 def js_dependencies ['/design/nav.js'] end |
#resources_dir ⇒ String
Specifies the absolute path to the resources directory for that module. This directory should contain three subdirectories: haml/
, locales/
and www/
. This method should be redefined to overwrite this default value with the actual resources directory path.
30 31 32 |
# File 'lib/intranet/abstract_responder.rb', line 30 def resources_dir File.join(__dir__, 'resources') end |