Skip to content

Commit

Permalink
add Hash#expire_at.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Varabyou committed May 23, 2024
1 parent e217f77 commit a39bb28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/kredis/types/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class Kredis::Types::Hash < Kredis::Types::Proxying
prepend Kredis::DefaultValues

proxying :hget, :hset, :hmget, :hdel, :hgetall, :hkeys, :hvals, :del, :exists?
proxying :hget, :hset, :hmget, :hdel, :hgetall, :hkeys, :hvals, :del, :exists?, :expire, :expireat

attr_accessor :typed

Expand Down Expand Up @@ -47,6 +47,10 @@ def values
strings_to_types(hvals || [], typed)
end

def expire_at(datetime)
expireat datetime.to_i
end

private
def set_default
update(**default)
Expand Down

0 comments on commit a39bb28

Please sign in to comment.