moduleGitlab# A class that can be wrapped around an expensive method call so it's only# executed when actually needed.## Usage:## object = Gitlab::Lazy.new { some_expensive_work_here }## object['foo']# object.barclassLazy<BasicObjectdefinitialize(&block)@block=blockenddefmethod_missing(name,*args,&block)__evaluate__@result.__send__(name,*args,&block)enddefrespond_to_missing?(name,include_private=false)__evaluate__@result.respond_to?(name,include_private)||superendprivatedef__evaluate__@result=@block.callunlessdefined?(@result)endendend