Class: UU::Remote
- Inherits:
-
Object
- Object
- UU::Remote
- Defined in:
- lib/uu/remote.rb
Class Method Summary collapse
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
- #enable_at_exit ⇒ Object
- #eval_(code) ⇒ Object
-
#initialize(uri) ⇒ Remote
constructor
A new instance of Remote.
- #klass(klass_) ⇒ Object
- #run(&block) ⇒ Object
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_service ⇒ Object
9 10 11 |
# File 'lib/uu/remote.rb', line 9 def self.start_service DRb.start_service end |
.stop_service ⇒ Object
13 14 15 |
# File 'lib/uu/remote.rb', line 13 def self.stop_service DRb.stop_service end |
Instance Method Details
#disable ⇒ Object
21 22 23 |
# File 'lib/uu/remote.rb', line 21 def disable @remote.disable end |
#enable ⇒ Object
25 26 27 |
# File 'lib/uu/remote.rb', line 25 def enable @remote.enable end |
#enable_at_exit ⇒ Object
44 45 46 |
# File 'lib/uu/remote.rb', line 44 def enable_at_exit at_exit { enable } end |
#eval_(code) ⇒ Object
29 30 31 |
# File 'lib/uu/remote.rb', line 29 def eval_(code) @remote.eval_(code) end |
#klass(klass_) ⇒ Object
33 34 35 |
# File 'lib/uu/remote.rb', line 33 def klass(klass_) @remote.klass(klass_.to_s) end |
#run(&block) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/uu/remote.rb', line 37 def run(&block) disable instance_eval(&block) ensure enable end |