|
1 | | -#' The Plumber Class |
| 1 | +#' The Plumber2 Class |
2 | 2 | #' |
3 | 3 | #' @description |
4 | 4 | #' This class encapsulates all of the logic of a plumber2 api, and is what gets |
5 | | -#' passed around in the functional api of plumber2. The Plumber class is a |
| 5 | +#' passed around in the functional api of plumber2. The Plumber2 class is a |
6 | 6 | #' subclass of the [fiery::Fire] class. Please consult the documentation for |
7 | 7 | #' this for additional information on what this type of server is capable of. |
8 | | -#' Note that the Plumber objects are reference objects, meaning that any change |
| 8 | +#' Note that the Plumber2 objects are reference objects, meaning that any change |
9 | 9 | #' to it will change all instances of the object. |
10 | 10 | #' |
11 | 11 | #' ## Initialization |
12 | | -#' A new 'Plumber'-object is initialized using the `new()` method on the |
| 12 | +#' A new 'Plumber2'-object is initialized using the `new()` method on the |
13 | 13 | #' generator: |
14 | 14 | #' |
15 | 15 | #' \tabular{l}{ |
16 | | -#' `api <- Plumber$new()` |
| 16 | +#' `api <- Plumber2$new()` |
17 | 17 | #' } |
18 | 18 | #' |
19 | 19 | #' However, most users will use the functional api of the package and thus |
20 | 20 | #' construct one using [api()] |
21 | 21 | #' |
22 | 22 | #' ## Copying |
23 | | -#' As `Plumber` objects are using reference semantics new copies of an api cannot |
24 | | -#' be made simply be assigning it to a new variable. If a true copy of a `Plumber` |
| 23 | +#' As `Plumber2` objects are using reference semantics new copies of an api cannot |
| 24 | +#' be made simply be assigning it to a new variable. If a true copy of a `Plumber2` |
25 | 25 | #' object is desired, use the `clone()` method. |
26 | 26 | #' |
27 | 27 | #' @importFrom R6 R6Class |
|
32 | 32 | #' |
33 | 33 | #' @export |
34 | 34 | #' |
35 | | -Plumber <- R6Class( |
36 | | - "Plumber", |
| 35 | +Plumber2 <- R6Class( |
| 36 | + "Plumber2", |
37 | 37 | inherit = Fire, |
38 | 38 | public = list( |
39 | | - #' @description Create a new `Plumber` api |
| 39 | + #' @description Create a new `Plumber2` api |
40 | 40 | #' @param host A string overriding the default host |
41 | 41 | #' @param port An port number overriding the default port |
42 | 42 | #' @param doc_type The type of API documentation to generate. Can be either |
@@ -72,7 +72,7 @@ Plumber <- R6Class( |
72 | 72 | #' handling |
73 | 73 | #' @param env An environment that will be used as the default execution |
74 | 74 | #' environment for the API |
75 | | - #' @return A `Plumber` object |
| 75 | + #' @return A `Plumber2` object |
76 | 76 | initialize = function( |
77 | 77 | host = get_opts("host", "127.0.0.1"), |
78 | 78 | port = get_opts("port", 8080), |
@@ -176,7 +176,7 @@ Plumber <- R6Class( |
176 | 176 |
|
177 | 177 | if (!silent) |
178 | 178 | cli::cli_text( |
179 | | - "Plumber server started at http://{self$host}:{self$port}" |
| 179 | + "Plumber2 server started at http://{self$host}:{self$port}" |
180 | 180 | ) |
181 | 181 | super$ignite(block = block, showcase = showcase, ..., silent = TRUE) |
182 | 182 | }, |
|
0 commit comments