Class: Pangea::RequestOptions
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Pangea::RequestOptions
- Defined in:
- lib/pangea/request_options.rb
Instance Attribute Summary collapse
-
#max_retries ⇒ Integer?
Maximum number of retries to attempt after a failed initial request.
-
#timeout ⇒ Float?
Request timeout in seconds.
Class Method Summary collapse
- .validate!(opts) ⇒ Object private
Methods inherited from Internal::Type::BaseModel
#==, coerce, #deconstruct_keys, dump, fields, #initialize, #inspect, known_fields, optional, required, #to_h
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, type_info
Constructor Details
This class inherits a constructor from Pangea::Internal::Type::BaseModel
Instance Attribute Details
#max_retries ⇒ Integer?
Maximum number of retries to attempt after a failed initial request.
27 |
# File 'lib/pangea/request_options.rb', line 27 optional :max_retries, Integer |
#timeout ⇒ Float?
Request timeout in seconds.
33 |
# File 'lib/pangea/request_options.rb', line 33 optional :timeout, Float |
Class Method Details
.validate!(opts) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pangea/request_options.rb', line 10 def self.validate!(opts) case opts in Pangea::RequestOptions | Hash opts.to_h.each_key do |k| unless fields.include?(k) raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") end end else raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") end end |