Module: Eywa::GlobalClient

Extended by:
GlobalClient
Included in:
GlobalClient
Defined in:
lib/eywa.rb

Overview

Convenience module for global access

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, **kwargs, &block) ⇒ Object

Delegate all methods to the client instance



221
222
223
224
225
226
227
# File 'lib/eywa.rb', line 221

def method_missing(method_name, *args, **kwargs, &block)
  if client.respond_to?(method_name)
    client.send(method_name, *args, **kwargs, &block)
  else
    super
  end
end

Instance Method Details

#clientObject



216
217
218
# File 'lib/eywa.rb', line 216

def client
  @client ||= Client.new
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:



229
230
231
# File 'lib/eywa.rb', line 229

def respond_to_missing?(method_name, include_private = false)
  client.respond_to?(method_name, include_private) || super
end