Class: ApiEntreprise::Commons::ClientBase
- Inherits:
-
Object
- Object
- ApiEntreprise::Commons::ClientBase
- Defined in:
- lib/api_entreprise/commons/client_base.rb
Direct Known Subclasses
Constant Summary collapse
- REQUIRED_PARAMS =
%i[recipient context object].freeze
- SIRET_PARAMS =
%i[recipient].freeze
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #get(path, params: {}, headers: {}) ⇒ Object
-
#initialize(configuration, product:) ⇒ ClientBase
constructor
A new instance of ClientBase.
Constructor Details
#initialize(configuration, product:) ⇒ ClientBase
Returns a new instance of ClientBase.
29 30 31 32 33 |
# File 'lib/api_entreprise/commons/client_base.rb', line 29 def initialize(configuration, product:) @configuration = configuration @product = product @connection = build_connection end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
24 25 26 |
# File 'lib/api_entreprise/commons/client_base.rb', line 24 def configuration @configuration end |
Instance Method Details
#get(path, params: {}, headers: {}) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/api_entreprise/commons/client_base.rb', line 35 def get(path, params: {}, headers: {}) merged = merge_params(params) validate_required!(merged) validate_sirets!(merged) response = @connection.get(path, clean(merged), headers) build_response(response) end |