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.



119
120
121
122
# File 'lib/zoidberg/shell.rb', line 119

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



123
124
125
126
# File 'lib/zoidberg/shell.rb', line 123

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.



118
119
120
# File 'lib/zoidberg/shell.rb', line 118

def locked
  @locked
end

#targetObject (readonly)

Returns the value of attribute target.



118
119
120
# File 'lib/zoidberg/shell.rb', line 118

def target
  @target
end