Sha256: fd2c15165480b688dced9ed6faaa91f67c8d5e4ebcde89d0d96227ef9a239eec

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

require 'delegate'

module Alki
  module Reload
    class AssemblyDelegator < Delegator
      def initialize(obj,watcher,reloader)
        @obj = obj
        @loaded = false
        @watcher = watcher
        @reloader = reloader
      end

      def __unload__
        @reloader.reload
      end

      def __getobj__
        unless @loaded
          @loaded = true
          @watcher.start
        end
        @obj
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alki-reload-0.3.2 lib/alki/reload/assembly_delegator.rb
alki-reload-0.3.1 lib/alki/reload/assembly_delegator.rb