Class: IronWorkerNG::ClientProxyCaller

Inherits:
Object
  • Object
show all
Defined in:
lib/iron_worker_ng/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, prefix) ⇒ ClientProxyCaller

Returns a new instance of ClientProxyCaller.



10
11
12
13
# File 'lib/iron_worker_ng/client.rb', line 10

def initialize(client, prefix)
  @client = client
  @prefix = prefix
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/iron_worker_ng/client.rb', line 15

def method_missing(name, *args, &block)
  full_name = @prefix.to_s + '_' + name.to_s
  if @client.respond_to?(full_name)
    @client.send(full_name, *args, &block)
  else
    super(name, *args, &block)
  end
end