Module: Primer::Lazyness::Macros
- Defined in:
- lib/primer/lazyness.rb
Instance Method Summary collapse
Instance Method Details
#lazy_patch(*method_names) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/primer/lazyness.rb', line 12 def lazy_patch(*method_names) method_names.each do |method_name| instance_eval " alias :eager_\#{method_name} :\#{method_name}\n def \#{method_name}(*args, &block)\n Primer::Lazyness::Proxy.new(self, primary_key, :eager_\#{method_name}, args, block)\n end\n RUBY\n end\nend\n" |