15
15
# ' \dontrun{
16
16
# ' right <- geoflow_right$new()
17
17
# ' right$setKey("use")
18
- # ' right$setValue ("No restrictions")
18
+ # ' right$setValues ("No restrictions")
19
19
# ' }
20
20
# '
21
21
# ' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
@@ -24,8 +24,8 @@ geoflow_right <- R6Class("geoflow_right",
24
24
public = list (
25
25
# '@field key right key
26
26
key = NULL ,
27
- # '@field value right value
28
- value = NULL ,
27
+ # '@field values right values
28
+ values = list () ,
29
29
30
30
# '@description Initializes an object of class \link{geoflow_right}
31
31
# '@param str character string to initialize from using key-based syntax
@@ -34,10 +34,21 @@ geoflow_right <- R6Class("geoflow_right",
34
34
if (! is.null(str )){
35
35
right <- extract_kvp(str )
36
36
self $ setKey(right $ key )
37
- self $ setValue(paste( right $ values , collapse = " , " ) )
37
+ self $ setValues( right $ values )
38
38
}else if (! is.null(kvp )){
39
39
self $ setKey(kvp $ key )
40
- self $ setValue(kvp $ values )
40
+ values = lapply(1 : length(kvp $ values ), function (i ){
41
+ right = kvp $ values [[i ]]
42
+ attributes(right ) <- NULL
43
+ val_locale_attrs <- attributes(kvp $ values )
44
+ for (attr_name in names(val_locale_attrs )){
45
+ locale_value <- val_locale_attrs [[attr_name ]][[i ]]
46
+ attributes(locale_value ) <- NULL
47
+ attr(right , attr_name ) <- locale_value
48
+ }
49
+ return (right )
50
+ })
51
+ self $ setValues(values )
41
52
}
42
53
},
43
54
@@ -47,10 +58,10 @@ geoflow_right <- R6Class("geoflow_right",
47
58
self $ key <- key
48
59
},
49
60
50
- # '@description Sets value
51
- # '@param value value
52
- setValue = function (value ){
53
- self $ value <- value
61
+ # '@description Sets values
62
+ # '@param values values
63
+ setValues = function (values ){
64
+ self $ values <- c( self $ values , values )
54
65
}
55
66
)
56
67
)
0 commit comments