Class: Squake::Client
- Inherits:
-
Object
- Object
- Squake::Client
- Extended by:
- T::Sig
- Defined in:
- lib/squake/client.rb
Constant Summary collapse
- JsonResponseBody =
T.type_alias do T.any( T::Array[T::Hash[Symbol, T.untyped]], T::Hash[Symbol, T.untyped], ) end
Instance Method Summary collapse
- #call(path:, headers: {}, method: :get, params: nil, api_base: nil, api_key: nil) ⇒ Object
-
#initialize(config: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(config: nil) ⇒ Client
Returns a new instance of Client.
18 19 20 |
# File 'lib/squake/client.rb', line 18 def initialize(config: nil) @config = T.let(config || T.must(Squake.configuration), Squake::Config) end |
Instance Method Details
#call(path:, headers: {}, method: :get, params: nil, api_base: nil, api_key: nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/squake/client.rb', line 32 def call(path:, headers: {}, method: :get, params: nil, api_base: nil, api_key: nil) execute_request( method: method, path: path, headers: headers, params: params, api_base: api_base, api_key: api_key, ) end |