Skip to content

Commit

Permalink
style(rubocop): Style/MissingRespondToMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Feb 12, 2024
1 parent 83ac764 commit ffcb707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/postal/message_db/delivery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def method_missing(name, value = nil, &block)
@attributes[name.to_s]
end

def respond_to_missing?(name)
@attributes.has_key?(name.to_s)
end

def timestamp
@timestamp ||= @attributes["timestamp"] ? Time.zone.at(@attributes["timestamp"]) : nil
end
Expand Down
5 changes: 5 additions & 0 deletions lib/postal/message_db/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ def method_missing(name, value = nil, &block)
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?
#
Expand Down

0 comments on commit ffcb707

Please sign in to comment.