style(rubocop): Style/MissingRespondToMissing

This commit is contained in:
Adam Cooke
2024-02-12 09:55:19 +00:00
parent 83ac764510
commit ffcb707247
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -25,6 +25,10 @@ module Postal
@attributes[name.to_s] @attributes[name.to_s]
end end
def respond_to_missing?(name)
@attributes.has_key?(name.to_s)
end
def timestamp def timestamp
@timestamp ||= @attributes["timestamp"] ? Time.zone.at(@attributes["timestamp"]) : nil @timestamp ||= @attributes["timestamp"] ? Time.zone.at(@attributes["timestamp"]) : nil
end end
+5
View File
@@ -185,6 +185,11 @@ module Postal
end end
end end
def respond_to_missing?(name)
name = name.to_s.sub(/=\z/, "")
@attributes.has_key?(name.to_s)
end
# #
# Has this message been persisted to the database yet? # Has this message been persisted to the database yet?
# #