Sha256: e2817bc2d3f1398a795fc2b828ad63ec7ec0edc8ac4ab0351addf2cc2320db1a

Contents?: true

Size: 1.96 KB

Versions: 1

Compression:

Stored size: 1.96 KB

Contents

# 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.
    # If redefined, this method should probably append dependencies rather than overwriting them.
    # @return [Array] The list of CSS dependencies, as URL path from server root
    def css_dependencies
      ['/design/style.css']
    end

    # Provides the list of Javascript files (JS) dependencies for this module.
    # If redefined, this method should probably append dependencies rather than overwriting them.
    # @return [Array] The list of JS dependencies, as URL path from server root
    def js_dependencies
      ['/design/nav.js']
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
intranet-core-1.2.0 lib/intranet/abstract_responder.rb