class Racket::Plugins::Base
Plugin base class. All plugins should inherit from this class.
Attributes
Public Class Methods
# File lib/racket/plugins/base.rb, line 26 def initialize(settings = {}) @settings = {} @settings.merge!(settings) if settings.is_a?(Hash) end
Public Instance Methods
This method should return an array of helpers (symbols) that the plugin wants to load automatically in every controller. If you do not want your controller to load any helpers automatically you do not need to override this method. You can still add your helpers to individual controllers by using Controller#helper.
@return [Array] An array of symbols representing helpers that should be loaded automatically
# File lib/racket/plugins/base.rb, line 37 def default_controller_helpers [] end
This method should return an array of [Module, Hash] arrays where each module represenents a Rack-compatible middleware module and the hash the settings that should be applied to that middleware. Each pair that the plugin provides will be automatically added to the middleware of the application. This is just for conveniance, a user could still add The same middleware using the global settings.
@return [Array] An array of [Module, Hash] pairs that represenents middleware that will be
loaded automatically by the plugin
# File lib/racket/plugins/base.rb, line 49 def middleware [] end