-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathClass-Arg.R
More file actions
48 lines (42 loc) · 1.02 KB
/
Class-Arg.R
File metadata and controls
48 lines (42 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright 2018 Opening Reproducible Research (https://o2r.info)
#' Arg-instruction class yet to be implemented
#' @include Class-Instruction.R
#'
#' See official documentation at \url{https://docs.docker.com/engine/reference/builder/#arg}.
#'
#' @return object
#' @family instruction classes
#' @examples
#' x = Arg("myarg")
#' print(x)
setClass(
"Arg",
slots = list(argument = "character"),
contains = "Instruction",
validity = function(object) {
if (length(object@argument) == 1) TRUE else "argument must be length 1"
}
)
#' create objects of class Arg
#'
#'
#' @param argument the argument name
#' @export
#' @return Arg-object
Arg <- function(argument) {
return(new("Arg", argument = argument))
}
setMethod(
"docker_key",
signature = signature(obj = "Arg"),
definition =
function(obj) {
return("ARG")
}
)
setMethod("docker_arguments",
signature(obj = "Arg"),
function(obj) {
argument <- methods::slot(obj, "argument")
return(argument)
})