diff --git a/lib/http/form_data/composite_io.rb b/lib/http/form_data/composite_io.rb index 33fa1f18..b9508f51 100644 --- a/lib/http/form_data/composite_io.rb +++ b/lib/http/form_data/composite_io.rb @@ -54,7 +54,7 @@ def read(length = nil, outbuf = nil) # @api public # @return [Integer] def size - @size ||= @ios.sum(&:size) + @size ||= @ios.sum(&:size) # steep:ignore end # Rewinds all IO objects and resets cursor diff --git a/lib/http/headers.rb b/lib/http/headers.rb index 892c28fe..af588f5a 100644 --- a/lib/http/headers.rb +++ b/lib/http/headers.rb @@ -184,7 +184,7 @@ def include?(name) # @return [Hash] # @api public def to_h - keys.to_h { |k| [k, self[k]] } + keys.to_h { |k| [k, self[k]] } # steep:ignore end # @!method to_hash # @see #to_h @@ -200,7 +200,7 @@ def to_h # @return [Hash{Symbol => Object}] # @api public def deconstruct_keys(keys) - hash = @pile.map { |_, k, _| k }.to_h { |k| [k.tr("A-Z-", "a-z_").to_sym, self[k]] } + hash = @pile.map { |_, k, _| k }.to_h { |k| [k.tr("A-Z-", "a-z_").to_sym, self[k]] } # steep:ignore keys ? hash.slice(*keys) : hash end diff --git a/lib/http/options.rb b/lib/http/options.rb index ff13359d..84cca6a4 100644 --- a/lib/http/options.rb +++ b/lib/http/options.rb @@ -61,7 +61,7 @@ class << self def new(options = nil, **kwargs) return options if options.is_a?(self) - super(**(options || kwargs)) # steep:ignore + super(**(options || kwargs)) end # Returns list of defined option names @@ -181,7 +181,7 @@ def merge(other) # @api public # @return [Hash] def to_hash - self.class.defined_options.to_h { |opt_name| [opt_name, public_send(opt_name)] } + self.class.defined_options.to_h { |opt_name| [opt_name, public_send(opt_name)] } # steep:ignore end # Duplicates the options object diff --git a/lib/http/options/definitions.rb b/lib/http/options/definitions.rb index ecea56a3..45ddfba2 100644 --- a/lib/http/options/definitions.rb +++ b/lib/http/options/definitions.rb @@ -45,7 +45,7 @@ def features=(features) unless (feature = self.class.available_features[name]) argument_error! "Unsupported feature: #{name}" end - feature.new(**opts_or_feature) # steep:ignore + feature.new(**opts_or_feature) end end end diff --git a/lib/http/response/status.rb b/lib/http/response/status.rb index 441102f5..3e1d7d48 100644 --- a/lib/http/response/status.rb +++ b/lib/http/response/status.rb @@ -66,7 +66,7 @@ def symbolize(str) # SYMBOL_CODES[:im_a_teapot] # => 418 # # @return [Hash Fixnum>] - SYMBOL_CODES = SYMBOLS.to_h { |k, v| [v, k] }.freeze + SYMBOL_CODES = SYMBOLS.invert.freeze # The numeric status code # diff --git a/lib/http/timeout/per_operation.rb b/lib/http/timeout/per_operation.rb index 5a5d3855..b7a6724d 100644 --- a/lib/http/timeout/per_operation.rb +++ b/lib/http/timeout/per_operation.rb @@ -9,7 +9,7 @@ module Timeout # Timeout handler with separate timeouts for connect, read, and write class PerOperation < Null # Mapping of shorthand option keys to their full forms - KEYS = %i[read write connect].to_h { |k| [k, :"#{k}_timeout"] }.freeze + KEYS = { read: :read_timeout, write: :write_timeout, connect: :connect_timeout }.freeze # Normalize and validate timeout options #