style(rubocop): Style/PreferredHashMethods

This commit is contained in:
Adam Cooke
2024-02-12 09:55:19 +00:00
parent ffcb707247
commit 013b3ea931
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -20,13 +20,13 @@ module Postal
end end
def method_missing(name, value = nil, &block) 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] @attributes[name.to_s]
end end
def respond_to_missing?(name) def respond_to_missing?(name)
@attributes.has_key?(name.to_s) @attributes.key?(name.to_s)
end end
def timestamp def timestamp
+2 -2
View File
@@ -178,7 +178,7 @@ module Postal
#  Provide access to set and get acceptable attributes #  Provide access to set and get acceptable attributes
# #
def method_missing(name, value = nil, &block) def method_missing(name, value = nil, &block)
if @attributes.has_key?(name.to_s) if @attributes.key?(name.to_s)
@attributes[name.to_s] @attributes[name.to_s]
elsif name.to_s =~ /=\z/ elsif name.to_s =~ /=\z/
@attributes[name.to_s.gsub("=", "").to_s] = value @attributes[name.to_s.gsub("=", "").to_s] = value
@@ -187,7 +187,7 @@ module Postal
def respond_to_missing?(name) def respond_to_missing?(name)
name = name.to_s.sub(/=\z/, "") name = name.to_s.sub(/=\z/, "")
@attributes.has_key?(name.to_s) @attributes.key?(name.to_s)
end end
# #