Class: Zoidberg::SoftShell::AsyncProxy
- Inherits:
-
Object
- Object
- Zoidberg::SoftShell::AsyncProxy
- Defined in:
- lib/zoidberg/shell.rb
Instance Attribute Summary collapse
-
#origin_proxy ⇒ Object
readonly
Returns the value of attribute origin_proxy.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(instance, proxy) ⇒ AsyncProxy
constructor
A new instance of AsyncProxy.
- #method_missing(*args, &block) ⇒ Object
Constructor Details
#initialize(instance, proxy) ⇒ AsyncProxy
Returns a new instance of AsyncProxy.
14 15 16 17 |
# File 'lib/zoidberg/shell.rb', line 14 def initialize(instance, proxy) @target = instance @origin_proxy = proxy end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/zoidberg/shell.rb', line 18 def method_missing(*args, &block) target._zoidberg_thread( Thread.new{ begin target.send(*args, &block) rescue StandardError, ScriptError => e origin_proxy._zoidberg_unexpected_error(e) raise end } ) nil end |
Instance Attribute Details
#origin_proxy ⇒ Object (readonly)
Returns the value of attribute origin_proxy.
13 14 15 |
# File 'lib/zoidberg/shell.rb', line 13 def origin_proxy @origin_proxy end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
12 13 14 |
# File 'lib/zoidberg/shell.rb', line 12 def target @target end |