Module: Gems::AbstractClient::ClassMethods

Defined in:
lib/gems/abstract_client.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

Delegate to Gems::Client



13
14
15
16
# File 'lib/gems/abstract_client.rb', line 13

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

Instance Method Details

#new(options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/gems/abstract_client.rb', line 8

def new(options = {})
  raise NotImplementedError.new
end

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

Returns:

  • (Boolean)


18
19
20
# File 'lib/gems/abstract_client.rb', line 18

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

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

Returns:

  • (Boolean)


22
23
24
# File 'lib/gems/abstract_client.rb', line 22

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