Class: ZammadAPI::Client
- Inherits:
-
Object
- Object
- ZammadAPI::Client
- Defined in:
- lib/zammad_api/client.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #method_missing(method, *_args) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *_args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/zammad_api/client.rb', line 17 def method_missing(method, *_args) method = modulize( method.to_s ) class_name = "ZammadAPI::Resources::#{method}" begin class_object = Kernel.const_get(class_name) rescue raise "Resource for #{method} does not exist" end ZammadAPI::Dispatcher.new(@transport, class_object) end |