Module: AMarmita::ClassMethods

Included in:
AMarmita
Defined in:
lib/a_marmita.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



49
50
51
52
53
# File 'lib/a_marmita.rb', line 49

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

Instance Method Details

#new_clientObject



41
42
43
# File 'lib/a_marmita.rb', line 41

def new_client
  Client.new
end

#singletonObject



45
46
47
# File 'lib/a_marmita.rb', line 45

def singleton
  @singleton ||= Client.new
end