Module: Shoulda::Matchers::Integrations::Inclusion
- Included in:
- Libraries::ActionController, Libraries::ActiveModel, Libraries::ActiveRecord, Libraries::Routing
- Defined in:
- lib/shoulda/matchers/integrations/inclusion.rb
Instance Method Summary collapse
Instance Method Details
#include_into(mod, *other_mods, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/shoulda/matchers/integrations/inclusion.rb', line 6 def include_into(mod, *other_mods, &block) mods_to_include = other_mods.dup mods_to_extend = other_mods.dup if block mods_to_include << Module.new(&block) end mod.__send__(:include, *mods_to_include) mod.extend(*mods_to_extend) end |