Class: LazyModule

Inherits:
Module show all
Defined in:
lib/extlib/lazy_module.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Methods inherited from Module

#find_const, #try_dup

Class Method Details

.new(&blk) ⇒ Object


2
3
4
5
6
7
8
9
10
# File 'lib/extlib/lazy_module.rb', line 2

def self.new(&blk)
  # passing no-op block overrides &blk
  m = super{ }
  class << m
    include ClassMethods
  end
  m.lazy_evaluated_body = blk
  m
end