Class: UU::Remote

Inherits:
Object
  • Object
show all
Defined in:
lib/uu/remote.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Remote

Returns a new instance of Remote.



17
18
19
# File 'lib/uu/remote.rb', line 17

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

Class Method Details

.start_serviceObject



9
10
11
# File 'lib/uu/remote.rb', line 9

def self.start_service
  DRb.start_service
end

.stop_serviceObject



13
14
15
# File 'lib/uu/remote.rb', line 13

def self.stop_service
  DRb.stop_service
end

Instance Method Details

#eval_(code) ⇒ Object



21
22
23
# File 'lib/uu/remote.rb', line 21

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

#klass(klass_) ⇒ Object



25
26
27
# File 'lib/uu/remote.rb', line 25

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

#run(&block) ⇒ Object



29
30
31
32
33
34
# File 'lib/uu/remote.rb', line 29

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