Module: Raiblocks::Proxy
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &_block) ⇒ Object
91
92
93
94
95
|
# File 'lib/raiblocks/proxy.rb', line 91
def method_missing(m, *args, &_block)
return super unless methods.include?(m)
self.class.define_proxy_method(m)
send(m, args.first)
end
|
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3
4
5
|
# File 'lib/raiblocks/proxy.rb', line 3
def client
@client
end
|
Class Method Details
.included(base) ⇒ Object
9
10
11
|
# File 'lib/raiblocks/proxy.rb', line 9
def self.included(base)
base.extend(ClassMethods)
end
|
Instance Method Details
#initialize(opts = {}) ⇒ Object
5
6
7
|
# File 'lib/raiblocks/proxy.rb', line 5
def initialize(opts = {})
@client = opts[:client] || Raiblocks.client
end
|
#methods ⇒ Object
76
77
78
|
# File 'lib/raiblocks/proxy.rb', line 76
def methods
(super + proxy_methods).sort
end
|
#proxy_methods ⇒ Object
72
73
74
|
# File 'lib/raiblocks/proxy.rb', line 72
def proxy_methods
self.class.proxy_methods
end
|