1313# ' @field item_self integer [optional]
1414# ' @field item_private character [optional]
1515# ' @field item_super character [optional]
16+ # ' @field empty_string character [optional]
1617# ' @importFrom R6 R6Class
1718# ' @importFrom jsonlite fromJSON toJSON
1819# ' @export
@@ -22,6 +23,7 @@ Special <- R6::R6Class(
2223 `item_self` = NULL ,
2324 `item_private` = NULL ,
2425 `item_super` = NULL ,
26+ `empty_string` = NULL ,
2527 # ' Initialize a new Special class.
2628 # '
2729 # ' @description
@@ -30,10 +32,11 @@ Special <- R6::R6Class(
3032 # ' @param item_self item_self
3133 # ' @param item_private item_private
3234 # ' @param item_super item_super
35+ # ' @param empty_string empty_string
3336 # ' @param ... Other optional arguments.
3437 # ' @export
3538 initialize = function (
36- `item_self` = NULL , `item_private` = NULL , `item_super` = NULL , ...
39+ `item_self` = NULL , `item_private` = NULL , `item_super` = NULL , `empty_string` = NULL , ...
3740 ) {
3841 if (! is.null(`item_self` )) {
3942 stopifnot(is.numeric(`item_self` ), length(`item_self` ) == 1 )
@@ -47,6 +50,10 @@ Special <- R6::R6Class(
4750 stopifnot(is.character(`item_super` ), length(`item_super` ) == 1 )
4851 self $ `item_super` <- `item_super`
4952 }
53+ if (! is.null(`empty_string` )) {
54+ stopifnot(is.character(`empty_string` ), length(`empty_string` ) == 1 )
55+ self $ `empty_string` <- `empty_string`
56+ }
5057 },
5158 # ' To JSON string
5259 # '
@@ -69,6 +76,10 @@ Special <- R6::R6Class(
6976 SpecialObject [[' super' ]] <-
7077 self $ `item_super`
7178 }
79+ if (! is.null(self $ `empty_string` )) {
80+ SpecialObject [[' empty_string' ]] <-
81+ self $ `empty_string`
82+ }
7283
7384 SpecialObject
7485 },
@@ -91,6 +102,9 @@ Special <- R6::R6Class(
91102 if (! is.null(this_object $ `super` )) {
92103 self $ `item_super` <- this_object $ `super`
93104 }
105+ if (! is.null(this_object $ `empty_string` )) {
106+ self $ `empty_string` <- this_object $ `empty_string`
107+ }
94108 self
95109 },
96110 # ' To JSON string
@@ -122,6 +136,13 @@ Special <- R6::R6Class(
122136 "%s"
123137 ' ,
124138 self $ `item_super`
139+ )},
140+ if (! is.null(self $ `empty_string` )) {
141+ sprintf(
142+ ' "empty_string":
143+ "%s"
144+ ' ,
145+ self $ `empty_string`
125146 )}
126147 )
127148 jsoncontent <- paste(jsoncontent , collapse = " ," )
@@ -140,6 +161,7 @@ Special <- R6::R6Class(
140161 self $ `item_self` <- this_object $ `item_self`
141162 self $ `item_private` <- this_object $ `item_private`
142163 self $ `item_super` <- this_object $ `item_super`
164+ self $ `empty_string` <- this_object $ `empty_string`
143165 self
144166 },
145167 # ' Validate JSON input with respect to Special
0 commit comments