StubCounter: StubCounter

StubCounterR Documentation

StubCounter

Description

hash with counter to store requests and count number of requests made against the stub

Public fields

hash

(list) a list for internal use only, with elements key, sig, and count

Methods

Public methods


Method put()

Register a request by it's key

Usage
StubCounter$put(x)
Arguments
x

an object of class RequestSignature

Returns

nothing returned; registers request & iterates internal counter


Method count()

Get the count of number of times any matching request has been made against this stub

Usage
StubCounter$count()

Method clone()

The objects of this class are cloneable with this method.

Usage
StubCounter$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

x <- StubCounter$new()
x
x$hash
x$count()
z <- RequestSignature$new(method = "get", uri = "https:/httpbin.org/get")
x$put(z)
x$count()
x$put(z)
x$count()

ropenscilabs/webmockr documentation built on May 25, 2023, 4:39 a.m.