diff options
Diffstat (limited to 'lib/infrastructure/lazy.rb')
| -rw-r--r-- | lib/infrastructure/lazy.rb | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/infrastructure/lazy.rb b/lib/infrastructure/lazy.rb deleted file mode 100644 index 4aa18e1..0000000 --- a/lib/infrastructure/lazy.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spank' - -module Booty - class Lazy - def initialize(resolver = ->() { }) - @resolver = resolver - end - - def method_missing(name, *args, &block) - @target ||= @resolver.call - @target.send(name, args, &block) - end - - def self.load(key, resolver = ->() { Spank::IOC.resolve(key) }) - Lazy.new(resolver) - end - end -end |
