From 013b3ea9315c14f24b08574d68e1688f33d78b8d Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Sat, 10 Feb 2024 23:37:58 +0000 Subject: [PATCH] style(rubocop): Style/PreferredHashMethods --- lib/postal/message_db/delivery.rb | 4 ++-- lib/postal/message_db/message.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/postal/message_db/delivery.rb b/lib/postal/message_db/delivery.rb index 5b8fe0c..1fbeb48 100644 --- a/lib/postal/message_db/delivery.rb +++ b/lib/postal/message_db/delivery.rb @@ -20,13 +20,13 @@ module Postal end def method_missing(name, value = nil, &block) - return unless @attributes.has_key?(name.to_s) + return unless @attributes.key?(name.to_s) @attributes[name.to_s] end def respond_to_missing?(name) - @attributes.has_key?(name.to_s) + @attributes.key?(name.to_s) end def timestamp diff --git a/lib/postal/message_db/message.rb b/lib/postal/message_db/message.rb index 7b1bff3..7222640 100644 --- a/lib/postal/message_db/message.rb +++ b/lib/postal/message_db/message.rb @@ -178,7 +178,7 @@ module Postal #  Provide access to set and get acceptable attributes # def method_missing(name, value = nil, &block) - if @attributes.has_key?(name.to_s) + if @attributes.key?(name.to_s) @attributes[name.to_s] elsif name.to_s =~ /=\z/ @attributes[name.to_s.gsub("=", "").to_s] = value @@ -187,7 +187,7 @@ module Postal def respond_to_missing?(name) name = name.to_s.sub(/=\z/, "") - @attributes.has_key?(name.to_s) + @attributes.key?(name.to_s) end #