Sha256: 7ffd4fe924d4acb57b951a7de5eb62a438559680483f532fcd6fece0fd5303eb

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 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

    # 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.1.1 lib/intranet/abstract_responder.rb