Module: NoBrainer::Criteria::Extend
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/no_brainer/criteria/extend.rb
Instance Method Summary collapse
Instance Method Details
#extend(*modules, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/no_brainer/criteria/extend.rb', line 6 def extend(*modules, &block) = modules. modules << Module.new(&block) if block return super(*modules) if [:original_behavior] chain(:extend => [modules]) end |
#merge!(criteria, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/no_brainer/criteria/extend.rb', line 14 def merge!(criteria, ={}) super.tap do @options[:extend].to_a.each { |modules| extend(*modules, :original_behavior => true) } end end |