mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-09-04 00:01:02 -04:00
removing setters from Options, which weren't public API anyway
This commit is contained in:
parent
9d910df01b
commit
cab5a94d31
@ -56,17 +56,6 @@ module HTTPX
|
||||
optname = Regexp.last_match(1).to_sym
|
||||
|
||||
attr_reader(optname)
|
||||
|
||||
class_eval(<<-OUT, __FILE__, __LINE__ + 1)
|
||||
def #{optname}=(value)
|
||||
return if value.nil?
|
||||
|
||||
value = #{meth}(value)
|
||||
|
||||
@#{optname} = value
|
||||
end
|
||||
protected :#{optname}=
|
||||
OUT
|
||||
end
|
||||
|
||||
def def_option(optname, *args, &block)
|
||||
@ -104,7 +93,8 @@ module HTTPX
|
||||
next if v.nil?
|
||||
|
||||
begin
|
||||
__send__(:"#{k}=", v)
|
||||
value = __send__(:"option_#{k}", v)
|
||||
instance_variable_set(:"@#{k}", value)
|
||||
rescue NoMethodError
|
||||
raise Error, "unknown option: #{k}"
|
||||
end
|
||||
@ -117,11 +107,7 @@ module HTTPX
|
||||
end
|
||||
|
||||
def option_headers(value)
|
||||
if headers
|
||||
headers.merge(value)
|
||||
else
|
||||
Headers.new(value)
|
||||
end
|
||||
Headers.new(value)
|
||||
end
|
||||
|
||||
def option_timeout(value)
|
||||
|
@ -20,59 +20,45 @@ module HTTPX
|
||||
| (Symbol) { (*nil) -> untyped } -> void
|
||||
# headers
|
||||
attr_reader uri: URI?
|
||||
def uri=: (uri) -> void
|
||||
|
||||
# headers
|
||||
attr_reader headers: Headers?
|
||||
def headers=: (headers) -> void
|
||||
|
||||
# timeout
|
||||
attr_reader timeout: timeout
|
||||
def timeout=: (timeout) -> void
|
||||
|
||||
# max_concurrent_requests
|
||||
attr_reader max_concurrent_requests: Integer?
|
||||
def max_concurrent_requests=: (Integer) -> void
|
||||
|
||||
# max_requests
|
||||
attr_reader max_requests: Integer?
|
||||
def max_requests=: (Integer) -> void
|
||||
|
||||
# window_size
|
||||
attr_reader window_size: Integer
|
||||
def window_size=: (int) -> void
|
||||
|
||||
# body_threshold_size
|
||||
attr_reader body_threshold_size: Integer
|
||||
def body_threshold_size=: (int) -> void
|
||||
|
||||
# transport
|
||||
attr_reader transport: String?
|
||||
def transport=: (_ToS) -> void
|
||||
|
||||
# transport_options
|
||||
attr_reader transport_options: Hash[untyped, untyped]?
|
||||
def transport_options=: (Hash[untyped, untyped]) -> void
|
||||
|
||||
# addresses
|
||||
attr_reader addresses: _ToAry[ipaddr]?
|
||||
def addresses=: (_ToAry[ipaddr]) -> void
|
||||
|
||||
# params
|
||||
attr_reader params: Transcoder::urlencoded_input?
|
||||
def params=: (Transcoder::urlencoded_input) -> void
|
||||
|
||||
# form
|
||||
attr_reader form: Transcoder::urlencoded_input?
|
||||
def form=: (Transcoder::urlencoded_input) -> void
|
||||
|
||||
# json
|
||||
attr_reader json: _ToJson?
|
||||
def json=: (_ToJson) -> void
|
||||
|
||||
# body
|
||||
attr_reader body: bodyIO?
|
||||
def body=: (bodyIO) -> void
|
||||
|
||||
# ssl
|
||||
|
||||
@ -81,25 +67,18 @@ module HTTPX
|
||||
|
||||
# classes
|
||||
attr_reader connection_class: singleton(Connection)
|
||||
def connection_class=: (singleton(Connection)) -> void
|
||||
|
||||
attr_reader request_class: singleton(Request)
|
||||
def request_class=: (singleton(Request)) -> void
|
||||
|
||||
attr_reader response_class: singleton(Response)
|
||||
def response_class=: (singleton(Response)) -> void
|
||||
|
||||
attr_reader headers_class: singleton(Headers)
|
||||
def headers_class=: (singleton(Headers)) -> void
|
||||
|
||||
attr_reader request_body_class: singleton(Request::Body)
|
||||
def request_body_class=: (singleton(Request::Body)) -> void
|
||||
|
||||
attr_reader response_body_class: singleton(Response::Body)
|
||||
def response_body_class=: (singleton(Response::Body)) -> void
|
||||
|
||||
attr_reader ssl: Hash[Symbol, untyped]
|
||||
def ssl=: (Hash[Symbol, untyped]) -> void
|
||||
|
||||
# request_class response_class headers_class request_body_class
|
||||
# response_body_class connection_class
|
||||
@ -108,27 +87,21 @@ module HTTPX
|
||||
# io
|
||||
type io_option = _ToIO | Hash[String, _ToIO]
|
||||
attr_reader io: io_option?
|
||||
def io=: (io_option) -> void
|
||||
|
||||
# fallback_protocol
|
||||
attr_reader fallback_protocol: String?
|
||||
def fallback_protocol=: (String) -> void
|
||||
|
||||
# debug
|
||||
attr_reader debug: _IOLogger?
|
||||
def debug=: (_IOLogger) -> void
|
||||
|
||||
# debug_level
|
||||
attr_reader debug_level: Integer
|
||||
def debug_level=: (Integer) -> void
|
||||
|
||||
# persistent
|
||||
attr_reader persistent: bool?
|
||||
def persistent=: (bool) -> void
|
||||
|
||||
# resolver_options
|
||||
attr_reader resolver_options: Hash[Symbol, untyped]?
|
||||
def resolver_options=: (Hash[Symbol, untyped]) -> void
|
||||
|
||||
def ==: (untyped other) -> bool
|
||||
def merge: (_ToHash[Symbol | String, untyped] other) -> instance
|
||||
|
@ -42,7 +42,6 @@ module HTTPX
|
||||
|
||||
interface _SigV4Options
|
||||
def sigv4_signer: () -> Signer?
|
||||
def sigv4_signer=: (Signer) -> Signer
|
||||
end
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _SigV4Options)
|
||||
|
@ -15,17 +15,15 @@ module HTTPX
|
||||
|
||||
def initialize: (Numeric bytesize) -> untyped
|
||||
end
|
||||
|
||||
|
||||
def self.configure: (singleton(Session)) -> void
|
||||
|
||||
interface _CompressionOptions
|
||||
def compression_threshold_size: () -> Integer?
|
||||
def compression_threshold_size=: (int) -> _ToInt
|
||||
|
||||
def encodings: () -> encodings_registry?
|
||||
def encodings=: (encodings_registry) -> encodings_registry
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _CompressionOptions)
|
||||
|
||||
|
||||
|
@ -5,9 +5,8 @@ module HTTPX
|
||||
|
||||
interface _CookieOptions
|
||||
def cookies: () -> Jar?
|
||||
def cookies=: (jar) -> Jar
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _CookieOptions)
|
||||
|
||||
module InstanceMethods
|
||||
|
@ -5,9 +5,8 @@ module HTTPX
|
||||
|
||||
interface _DigestOptions
|
||||
def digest: () -> Digest?
|
||||
def digest=: (Digest) -> Digest
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _DigestOptions)
|
||||
|
||||
def self.load_dependencies: (*untyped) -> void
|
||||
|
@ -2,15 +2,13 @@ module HTTPX
|
||||
module Plugins
|
||||
module Expect
|
||||
EXPECT_TIMEOUT: Integer
|
||||
|
||||
|
||||
interface _ExpectOptions
|
||||
def expect_timeout: () -> Integer?
|
||||
def expect_timeout=: (int) -> Integer
|
||||
|
||||
def expect_threshold_size: () -> Integer?
|
||||
def expect_threshold_size=: (int) -> Integer
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _ExpectOptions)
|
||||
end
|
||||
end
|
||||
|
@ -5,15 +5,13 @@ module HTTPX
|
||||
module FollowRedirects
|
||||
MAX_REDIRECTS: Integer
|
||||
REDIRECT_STATUS: Range[Integer]
|
||||
|
||||
|
||||
interface _FollowRedirectsOptions
|
||||
def max_redirects: () -> Integer?
|
||||
def max_redirects=: (int) -> Integer
|
||||
|
||||
def follow_insecure_redirects: () -> bool?
|
||||
def follow_insecure_redirects=: (bool) -> bool
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _FollowRedirectsOptions)
|
||||
|
||||
module InstanceMethods
|
||||
|
@ -16,7 +16,7 @@ module HTTPX
|
||||
type grpc_response = untyped | _Each[untyped]
|
||||
|
||||
type credentials = Proc
|
||||
|
||||
|
||||
class Call
|
||||
attr_writer decoder: _Callable
|
||||
|
||||
@ -41,7 +41,7 @@ module HTTPX
|
||||
|
||||
def self?.decode: (String message, encodings: Array[String], encoders: Compression::encodings_registry) -> String
|
||||
| (String message, encodings: Array[String], encoders: Compression::encodings_registry) { (String) -> void } -> void
|
||||
|
||||
|
||||
def self?.cancel: (Request) -> void
|
||||
|
||||
def self?.verify_status: (StreamResponse | response) -> void
|
||||
@ -49,19 +49,14 @@ module HTTPX
|
||||
|
||||
interface _GRPCOptions
|
||||
def grpc_service: () -> String?
|
||||
def grpc_service=: (string) -> String
|
||||
|
||||
def grpc_compression: () -> compression_option?
|
||||
def grpc_compression=: (compression_option) -> compression_option
|
||||
|
||||
def grpc_rpcs: () -> Hash[String, rpc_def]?
|
||||
def grpc_rpcs=: (Hash[String, rpc_def]) -> Hash[String, rpc_def]
|
||||
|
||||
def grpc_deadline: () -> Integer?
|
||||
def grpc_deadline=: (Integer) -> Integer
|
||||
|
||||
def call_credentials: () -> credentials?
|
||||
def call_credentials=: (credentials) -> credentials
|
||||
end
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _GRPCOptions)
|
||||
|
@ -4,9 +4,8 @@ module HTTPX
|
||||
|
||||
interface _NTLMOptions
|
||||
def ntlm: () -> NTLMParams?
|
||||
def ntlm=: (NTLMParams) -> NTLMParams
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _NTLMOptions)
|
||||
|
||||
def self.load_dependencies: (*untyped) -> void
|
||||
|
@ -2,15 +2,14 @@ module HTTPX
|
||||
module Plugins
|
||||
module Persistent
|
||||
def self.load_dependencies: (singleton(Session)) -> void
|
||||
|
||||
|
||||
interface _PersistentOptions
|
||||
def persistent: () -> bool?
|
||||
def persistent=: (bool) -> bool
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _PersistentOptions)
|
||||
end
|
||||
|
||||
|
||||
type sessionPersistent = sessionFollowRedirects
|
||||
end
|
||||
end
|
||||
|
@ -23,14 +23,13 @@ module HTTPX
|
||||
end
|
||||
|
||||
def self.configure: (singleton(Session)) -> void
|
||||
|
||||
|
||||
type proxyParam = Parameters | Hash[Symbol, untyped]
|
||||
|
||||
|
||||
interface _ProxyOptions
|
||||
def proxy: () -> proxyParam?
|
||||
def proxy=: (Parameters | _ToHash[Symbol, untyped]) -> proxyParam
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _ProxyOptions)
|
||||
|
||||
module InstanceMethods
|
||||
|
@ -1,8 +1,6 @@
|
||||
module HTTPX
|
||||
module Plugins
|
||||
module PushPromise
|
||||
def self.extra_options: (Options) -> Options
|
||||
|
||||
module ResponseMethods
|
||||
def pushed?: () -> boolish
|
||||
def mark_as_pushed!: () -> void
|
||||
|
@ -11,16 +11,12 @@ module HTTPX
|
||||
|
||||
interface _RetriesOptions
|
||||
def retry_after: () -> Numeric?
|
||||
def retry_after=: (Numeric) -> Numeric
|
||||
|
||||
def max_retries: () -> Integer?
|
||||
def max_retries=: (int) -> Integer
|
||||
|
||||
def retry_change_requests: () -> boolish
|
||||
def retry_change_requests=: (boolish) -> boolish
|
||||
|
||||
def retry_on: () -> _RetryCallback?
|
||||
def retry_on=: (_RetryCallback) -> _RetryCallback
|
||||
end
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _RetriesOptions)
|
||||
|
@ -7,9 +7,8 @@ module HTTPX
|
||||
|
||||
interface _UpgradeOptions
|
||||
def upgrade_handlers: () -> handlers_registry?
|
||||
def upgrade_handlers=: (handlers_registry) -> handlers_registry
|
||||
end
|
||||
|
||||
|
||||
def self.extra_options: (Options) -> (Options & _UpgradeOptions)
|
||||
|
||||
module ConnectionMethods
|
||||
@ -18,6 +17,6 @@ module HTTPX
|
||||
|
||||
def hijack_io: () -> void
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user