Class: Frontier::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/frontier/proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Proxy

Returns a new instance of Proxy.



7
8
9
10
# File 'lib/frontier/proxy.rb', line 7

def initialize(object)
  @typename = object.class.to_s
  @object = object.object_id
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



12
13
14
15
# File 'lib/frontier/proxy.rb', line 12

def method_missing(name, *args)
  request = { :object => @object, :name => name, :args => args }
  return @channel.submit(request)
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/frontier/proxy.rb', line 5

def channel
  @channel
end

Instance Method Details

#inspectObject



21
22
23
# File 'lib/frontier/proxy.rb', line 21

def inspect
  "#<Frontier::Proxy #{method_missing(:inspect)}>"
end

#to_sObject



17
18
19
# File 'lib/frontier/proxy.rb', line 17

def to_s
  method_missing(:to_s)
end