Skip to content

Commit

Permalink
Rubocop autocorrections
Browse files Browse the repository at this point in the history
  • Loading branch information
troya2 committed Jul 2, 2024
1 parent be6d875 commit 6a044fc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/open_weather/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def connection

options[:headers]['User-Agent'] = user_agent if user_agent
options[:proxy] = proxy if proxy
options[:ssl] = { ca_path: ca_path, ca_file: ca_file } if ca_path || ca_file
options[:ssl] = { ca_path:, ca_file: } if ca_path || ca_file

request_options = {}
request_options[:timeout] = timeout if timeout
Expand Down
8 changes: 4 additions & 4 deletions lib/open_weather/endpoints/current.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ module OpenWeather
module Endpoints
module Current
def current_zip(code, country = nil, options = {})
options = code.is_a?(Hash) ? options.merge(code) : options.merge(zip: code, country: country)
options = code.is_a?(Hash) ? options.merge(code) : options.merge(zip: code, country:)
current_weather(options)
end

def current_geo(lat, lon = nil, options = {})
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat:, lon:)
current_weather(options)
end

def current_city(name, state = nil, country = nil, options = {})
options = name.is_a?(Hash) ? options.merge(name) : options.merge(city: name, state: state, country: country)
options = name.is_a?(Hash) ? options.merge(name) : options.merge(city: name, state:, country:)
current_weather(options)
end

def current_city_id(id, options = {})
options = id.is_a?(Hash) ? options.merge(id) : options.merge(id: id)
options = id.is_a?(Hash) ? options.merge(id) : options.merge(id:)
current_weather(options)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/endpoints/one_call.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module OpenWeather
module Endpoints
module OneCall
def one_call(lat, lon = nil, options = {})
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat:, lon:)
options[:exclude] = options[:exclude].join(',') if options[:exclude].is_a?(Array)
options[:dt] = options[:dt].to_i if options[:dt].is_a?(Time)
path = options.key?(:dt) ? '3.0/onecall/timemachine' : '3.0/onecall'
Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def on_complete(env)
when 407
# mimic the behavior that we get with proxy requests with HTTPS
raise Faraday::ConnectionFailed, %(407 "Proxy Authentication Required ")
when (400...600).freeze
when (400...600)
raise OpenWeather::Errors::Fault, response_values(env)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/open_weather/models/station_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.with(id)
.and_call_original

model = OpenWeather::Models::Station.new(id: id)
model = OpenWeather::Models::Station.new(id:)
result = model.delete!
expect(result).to be_nil
end
Expand Down

0 comments on commit 6a044fc

Please sign in to comment.