Class: Zoidberg::HardShell::AsyncProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/zoidberg/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance, locked) ⇒ AsyncProxy

Returns a new instance of AsyncProxy.



187
188
189
190
# File 'lib/zoidberg/shell.rb', line 187

def initialize(instance, locked)
  @target = instance
  @locked = locked
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object



191
192
193
194
# File 'lib/zoidberg/shell.rb', line 191

def method_missing(*args, &block)
  target._async_request(locked ? :blocking : :nonblocking, *args, &block)
  nil
end

Instance Attribute Details

#lockedObject (readonly)

Returns the value of attribute locked.



186
187
188
# File 'lib/zoidberg/shell.rb', line 186

def locked
  @locked
end

#targetObject (readonly)

Returns the value of attribute target.



186
187
188
# File 'lib/zoidberg/shell.rb', line 186

def target
  @target
end