Module: Rails3::Plugin::Extender::DSL
- Includes:
- LoadHandler
- Defined in:
- lib/r3_plugin_toolbox/extender.rb
Instance Method Summary collapse
- #extend_from_module(base_name, *module_names) ⇒ Object
- #extend_with(*module_names) ⇒ Object (also: #with)
Methods included from LoadHandler
#after, #before, #load_handling, #on_load
Methods included from Util
#act_type?, #get_base_class, #get_constant, #get_load_type, #get_module, #make_constant, #rails_const_base
Instance Method Details
#extend_from_module(base_name, *module_names) ⇒ Object
49 50 51 52 53 |
# File 'lib/r3_plugin_toolbox/extender.rb', line 49 def extend_from_module base_name, *module_names module_names.each do |name| include get_constant(base_name, name) end end |
#extend_with(*module_names) ⇒ Object Also known as: with
55 56 57 58 59 60 61 62 63 |
# File 'lib/r3_plugin_toolbox/extender.rb', line 55 def extend_with *module_names module_names.each do |module_name| begin include get_module(module_name) rescue raise ArgumentError, "Unable to extend with #{module_name}" end end end |