Class: Heimdall::ObjectProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/heimdall/heimdall_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ ObjectProxy

Returns a new instance of ObjectProxy.



17
18
19
# File 'lib/heimdall/heimdall_proxy.rb', line 17

def initialize object
  @object = object
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/heimdall/heimdall_proxy.rb', line 21

def method_missing name, *args
  dump = Marshal.dump [@object, name, args]
  dump = Base64.encode64 dump
  dump = dump.sub %r{=*\s*$}, ''
  Heimdall.add HeimdallProxyWorker, b64: dump
  true
end