# frozen_string_literal: true module Intranet # The default implementation and interface of an Intranet module. class AbstractResponder # Returns the name of the module. # @return [String] The name of the module def self.module_name; end # The version of the module, according to semantic versionning. # @return [String] The version of the module def self.module_version; end # The homepage of the module, if any. # @return [String/Nil] The homepage URL of the module, or nil if no homepage is available. def self.module_homepage; end # Specifies if the responder instance should be displayed in the main navigation menu or not. # @return [Boolean] True if the responder instance should be added to the main navigation menu, # False otherwise. def in_menu? true end # Destroys the responder instance. # This method gets called when server is shut down. def finalize # nothing to do end # Generates the HTML content associated to the given +path+ and +query+. # @param path [String] The requested URI, relative to that module root URI # @param query [Hash] The URI variable/value pairs, if any # @return [Array] The HTTP return code, the MIME type and the answer body. def generate_page(path, query) [404, '', ''] end # 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. # @return [Array] The list of CSS dependencies, as absolute path or relative to the module root # URL. def css_dependencies ['/design/style.css'] end # 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. # @return [Array] The list of JS dependencies, as absolute path or relative to the module root # URL. def js_dependencies ['/design/nav.js'] end end end