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.



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

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



189
190
191
192
# File 'lib/zoidberg/shell.rb', line 189

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.



184
185
186
# File 'lib/zoidberg/shell.rb', line 184

def locked
  @locked
end

#targetObject (readonly)

Returns the value of attribute target.



184
185
186
# File 'lib/zoidberg/shell.rb', line 184

def target
  @target
end