Module: ActiveFunction
- Defined in:
- lib/active_function.rb,
lib/active_function/base.rb,
lib/active_function/version.rb,
lib/active_function/functions/response.rb,
lib/active_function/functions/callbacks.rb,
lib/active_function/functions/rendering.rb,
lib/active_function/functions/strong_parameters.rb
Defined Under Namespace
Modules: Functions Classes: Base, SuperBase
Constant Summary collapse
- VERSION =
"0.4.2"
Class Method Summary collapse
-
.config(&block) ⇒ void
Configure ActiveFunction through DSL method calls.
-
.plugin(mod) ⇒ void
Add plugin to ActiveFunction::Base.
-
.plugins ⇒ Object
List of registered internal plugins.
-
.register_plugin(symbol, mod) ⇒ Object
Register internal Symbol’ed plugin.
Class Method Details
.config(&block) ⇒ void
22 23 24 25 26 |
# File 'lib/active_function.rb', line 22 def config(&block) class_eval(&block) @_plugins.freeze self::Base.freeze end |
.plugin(mod) ⇒ void
This method returns an undefined value.
Add plugin to ActiveFunction::Base.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/active_function.rb', line 48 def plugin(mod) if mod.is_a? Symbol begin require "active_function/functions/#{mod}" mod = plugins.fetch(mod) rescue LoadError raise ArgumentError, "Unknown plugin #{mod}" end end self::Base.include(mod) end |
.plugins ⇒ Object
List of registered internal plugins.
29 |
# File 'lib/active_function.rb', line 29 def plugins = @_plugins ||= {} |
.register_plugin(symbol, mod) ⇒ Object
Register internal Symbol’ed plugin.
36 37 38 |
# File 'lib/active_function.rb', line 36 def register_plugin(symbol, mod) plugins[symbol] = mod end |