Module: Fend::Plugins

Defined in:
lib/fend.rb,
lib/fend/plugins/contexts.rb,
lib/fend/plugins/coercions.rb,
lib/fend/plugins/base_errors.rb,
lib/fend/plugins/dependencies.rb,
lib/fend/plugins/full_messages.rb,
lib/fend/plugins/value_helpers.rb,
lib/fend/plugins/data_processing.rb,
lib/fend/plugins/object_validation.rb,
lib/fend/plugins/validation_helpers.rb,
lib/fend/plugins/validation_options.rb,
lib/fend/plugins/external_validation.rb

Overview

Module in which all Fend plugins should be defined.

Defined Under Namespace

Modules: BaseErrors, Coercions, Contexts, Core, DataProcessing, Dependencies, ExternalValidation, FullMessages, ObjectValidation, ValidationHelpers, ValidationOptions, ValueHelpers

Class Method Summary collapse

Class Method Details

.load_plugin(name) ⇒ Object

Use plugin if already loaded. If not, load and return it.



29
30
31
32
33
34
35
36
# File 'lib/fend.rb', line 29

def self.load_plugin(name)
  unless plugin = @plugins[name]
    require "fend/plugins/#{name}"

    raise Error, "plugin #{name} did not register itself correctly in Fend::Plugins" unless plugin = @plugins[name]
  end
  plugin
end

.register_plugin(name, mod) ⇒ Object

Register plugin so that it can loaded.



39
40
41
# File 'lib/fend.rb', line 39

def self.register_plugin(name, mod)
  @plugins[name] = mod
end