Class: Async::Bus::Protocol::Proxy

Inherits:
BasicObject
Defined in:
lib/async/bus/protocol/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, name) ⇒ Proxy

Returns a new instance of Proxy.



25
26
27
28
# File 'lib/async/bus/protocol/proxy.rb', line 25

def initialize(connection, name)
	@connection = connection
	@name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*arguments, **options, &block) ⇒ Object



62
63
64
# File 'lib/async/bus/protocol/proxy.rb', line 62

def method_missing(*arguments, **options, &block)
	@connection.invoke(@name, arguments, options, &block)
end

Instance Method Details

#!Object



30
31
32
# File 'lib/async/bus/protocol/proxy.rb', line 30

def !
	@connection.invoke(@name, [:!])
end

#!=(object) ⇒ Object



38
39
40
# File 'lib/async/bus/protocol/proxy.rb', line 38

def != object
	@connection.invoke(@name, [:!=, object])
end

#==(object) ⇒ Object



34
35
36
# File 'lib/async/bus/protocol/proxy.rb', line 34

def == object
	@connection.invoke(@name, [:==, object])
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/async/bus/protocol/proxy.rb', line 42

def eql?(other)
	self.equal?(other)
end

#inspectObject



58
59
60
# File 'lib/async/bus/protocol/proxy.rb', line 58

def inspect
	"[Proxy (#{@name}) #{method_missing(:inspect)}]"
end

#methods(all = true) ⇒ Object



46
47
48
# File 'lib/async/bus/protocol/proxy.rb', line 46

def methods(all = true)
	@connection.invoke(@name, [:methods, all]) | super
end

#protected_methods(all = true) ⇒ Object



50
51
52
# File 'lib/async/bus/protocol/proxy.rb', line 50

def protected_methods(all = true)
	@connection.invoke(@name, [:protected_methods, all]) | super
end

#public_methods(all = true) ⇒ Object



54
55
56
# File 'lib/async/bus/protocol/proxy.rb', line 54

def public_methods(all = true)
	@connection.invoke(@name, [:public_methods, all]) | super
end

#respond_to?(name, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/async/bus/protocol/proxy.rb', line 66

def respond_to?(name, include_all = false)
	@connection.invoke(@name, [:respond_to?, name, include_all])
end

#respond_to_missing?(name, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/async/bus/protocol/proxy.rb', line 70

def respond_to_missing?(name, include_all = false)
	@connection.invoke(@name, [:respond_to?, name, include_all]) || super
end