Class: WestpacApi::Client
- Inherits:
-
Object
- Object
- WestpacApi::Client
- Defined in:
- lib/westpac_api/client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config:) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config:) ⇒ Client
Returns a new instance of Client.
21 22 23 |
# File 'lib/westpac_api/client.rb', line 21 def initialize(config:) @config = config end |
Class Method Details
.endpoint(name) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/westpac_api/client.rb', line 9 def self.endpoint(name) define_method(name) do |**args| klass_name = Hanami::Utils::String.classify(name) endpoint_klass = Hanami::Utils::Class.load!("WestpacApi::Endpoints::#{klass_name}") endpoint_klass.(config, **args) end end |