Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Summary closes #292 This pull request is for issue #292. I extend set method to accept a third positional argument. ## Purpose of This Change The primary goal of this change is to enhance the compatibility of the `mock_redis` `set` method with the `redis-store` `set` method. By introducing a third positional argument, we aim to align more closely with the `redis-store` implementation, facilitating easier integration and use in environments where `redis-store` is prevalent. ## Compatibility Concerns with Standard Redis While the `redis-store` `set` method accepts three positional arguments, the standard Redis `set` method traditionally takes only two. This discrepancy could raise concerns about compatibility. However, this change ensures that compatibility with the standard Redis API is maintained and verified through existing tests in `set_spec.rb`. ## Before and After the Change ### Before The `set` method in `mock_redis` was defined as follows: ```ruby def set(key, value, ex: nil, px: nil, exat: nil, pxat: nil, nx: nil, xx: nil, keepttl: nil, get: nil) ``` This definition aligns with the standard Redis API but lacks compatibility with the `redis-store` version. ### After The revised `set` method is now defined with an additional third positional argument: ```ruby def set(key, value, _hash = nil, ex: nil, px: nil, exat: nil, pxat: nil, nx: nil, xx: nil, keepttl: nil, get: nil) ``` This addition enables compatibility with `redis-store` without compromising the existing functionality with standard Redis.
- Loading branch information