Module: IncludeFor
- Defined in:
- lib/include_for.rb
Overview
IncludeFor
Instance Method Summary collapse
Instance Method Details
#include_for(*sources) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/include_for.rb', line 3 def include_for(*sources) sources = sources.flatten = sources.last.is_a?(Hash) ? sources.pop.symbolize_keys : {} group = .delete(:to) || :header global_cache = eval("@_include_for_#{options[:to]}_ ||= {}") private_cache = {} loadeds = sources.map do |source| include_for_cache_or_find(group, source, , global_cache, private_cache) end loadeds.compact end |