Module: Betterific::Client

Defined in:
lib/betterific/client.rb

Constant Summary collapse

CLIENT =

Delegate all methods to a client implementation if that client implementation supports the method. Use ProtobufClient if it’s available; otherwise, use JsonClient.

if defined?(Betterific::ProtobufClient)
  Betterific::ProtobufClient
else
  Betterific::JsonClient
end

Class Method Summary collapse

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

:nodoc:



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

def self.method_missing(method, *args, &block) #:nodoc:
  if CLIENT.respond_to?(method)
    return CLIENT.send(method, *args, &block)
  end
  super
end

.respond_to?(method) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/betterific/client.rb', line 13

def self.respond_to?(method) #:nodoc:
  return true if CLIENT.respond_to?(method)
  super
end