Sha256: e8a1a54876c543be9a69b1198fee6c065478ad19d518492a94cdede00efe4a85

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

require 'drb'
require 'drb/http0'
require 'drb/http0helper'

module UU
  class Remote
    def self.start_service
      DRb.start_service
    end

    def self.stop_service
      DRb.stop_service
    end

    def initialize(uri)
      @remote = DRbObject.new_with_uri(uri)
    end

    def eval_(code)
      @remote.eval_(code)
    end

    def klass(klass_)
      @remote.klass(klass_.to_s)
    end

    def run(&block)
      @remote.disable
      instance_eval(&block)
    ensure
      @remote.enable
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uu-0.1.1 lib/uu/remote.rb