hash with counter to store requests and count number of requests made against the stub
hash
(list) a list for internal use only, with elements
key
, sig
, and count
count()
Get the count of number of times any matching request has been made against this stub
x <- StubCounter$new()
x
#> <StubCounter>
#> Public:
#> clone: function (deep = FALSE)
#> count: function ()
#> hash: list
#> put: function (x)
#> Private:
#> total: 0
x$hash
#> list()
x$count()
#> [1] 0
z <- RequestSignature$new(method = "get", uri = "https:/httpbin.org/get")
x$put(z)
x$count()
#> [1] 1
x$put(z)
x$count()
#> [1] 2