method matcher
Methods
Method matches()
test if the pattern matches a given http method
Examples
(x <- MethodPattern$new(pattern = "post"))
#> <MethodPattern>
#> Public:
#> clone: function (deep = FALSE)
#> initialize: function (pattern)
#> matches: function (method)
#> pattern: post
#> to_s: function ()
x$pattern
#> [1] "post"
x$matches(method = "post")
#> [1] TRUE
x$matches(method = "POST")
#> [1] TRUE
# all matches() calls should be TRUE
(x <- MethodPattern$new(pattern = "any"))
#> <MethodPattern>
#> Public:
#> clone: function (deep = FALSE)
#> initialize: function (pattern)
#> matches: function (method)
#> pattern: any
#> to_s: function ()
x$pattern
#> [1] "any"
x$matches(method = "post")
#> [1] TRUE
x$matches(method = "GET")
#> [1] TRUE
x$matches(method = "HEAD")
#> [1] TRUE