Learn R Programming

vcr (version 0.2.6)

RequestIgnorer: Request ignorer

Description

Request ignorer

Arguments

LOCALHOST_ALIASES

A constant with values: 'localhost', '127.0.0.1', and '0.0.0.0'

ignored_hosts

Vector of ignored hosts

fun

A function, of the form: coming...

value

A localhost value to ignore, e.g, 'localhost'

hosts

Character vector of hosts to ignore

request

A request

Details

Hook to handle request ignorers, including:

Methods

ignore_request(fun)

Will ignore any request for which the given function returns TRUE

ignore_localhost()

ignore all localhost values (localhost, 127.0.0.1, 0.0.0.0)

ignore_localhost_value(value)

ignore a specific named localhost

ignore_hosts(hosts)

ignore any named host

should_be_ignored(request)

method to determine whether to ignore a request

Private Methods

ignored_hosts_init()

Initialize an empty ignored hosts object on package load

Examples

Run this code
# NOT RUN {
(x <- RequestIgnorer$new())
x$LOCALHOST_ALIASES
x$ignored_hosts
x$ignore_hosts(hosts = "google.com")
x$ignored_hosts
x$ignore_localhost()
x$ignored_hosts
x$ignore_localhost_value('127.0.0.1')
x$ignored_hosts
# }

Run the code above in your browser using DataLab