Class: FabApi::Client
- Inherits:
-
Object
- Object
- FabApi::Client
- Defined in:
- lib/fab_api/client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config: FabApi.config) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Class Method Details
.endpoint(name) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/fab_api/client.rb', line 12 def self.endpoint(name) define_method(name) do |**args| klass_name = Hanami::Utils::String.classify(name) endpoint_klass = Hanami::Utils::Class.load!("FabApi::Endpoints::#{klass_name}") endpoint_klass.(config, **args) end end |