Class: Nfe::RequestOptions
- Inherits:
-
Data
- Object
- Data
- Nfe::RequestOptions
- Defined in:
- lib/nfe/request_options.rb,
sig/nfe/request_options.rbs
Overview
Immutable per-call overrides for a single request. Passing a
RequestOptions to Client#request (or through a resource helper)
overrides the family-resolved api_key, base_url, and timeout for that
one call; any nil field falls back to normal family resolution.
This enables multi-tenant per-call keys without constructing a second
Nfe::Client.
Instance Attribute Summary collapse
-
#api_key ⇒ String?
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ String?
readonly
Returns the value of attribute base_url.
-
#timeout ⇒ Numeric?
readonly
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(api_key: nil, base_url: nil, timeout: nil) ⇒ RequestOptions
constructor
A new instance of RequestOptions.
Constructor Details
#initialize(api_key: nil, base_url: nil, timeout: nil) ⇒ RequestOptions
Returns a new instance of RequestOptions.
12 13 14 |
# File 'lib/nfe/request_options.rb', line 12 def initialize(api_key: nil, base_url: nil, timeout: nil) super end |
Instance Attribute Details
#api_key ⇒ String? (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'sig/nfe/request_options.rbs', line 3 def api_key @api_key end |
#base_url ⇒ String? (readonly)
Returns the value of attribute base_url.
4 5 6 |
# File 'sig/nfe/request_options.rbs', line 4 def base_url @base_url end |
#timeout ⇒ Numeric? (readonly)
Returns the value of attribute timeout.
5 6 7 |
# File 'sig/nfe/request_options.rbs', line 5 def timeout @timeout end |
Class Method Details
.new ⇒ instance
7 |
# File 'sig/nfe/request_options.rbs', line 7
def self.new: (?api_key: String?, ?base_url: String?, ?timeout: Numeric?) -> instance
|