Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Changed several methods to return invisible(self) for chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
jayqi committed Sep 12, 2018
1 parent d7a9453 commit db8bb9b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions R/module_custom_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ CustomFunctionModule <- R6::R6Class("CustomFunctionModule"
private$name <- name
private$fun <- fun

self$errorCheck()
return(self$errorCheck())
}

, clearOutputCache = function() {
Expand All @@ -128,7 +128,7 @@ CustomFunctionModule <- R6::R6Class("CustomFunctionModule"

private$futurePromise <- NULL

return(invisible(NULL))
return(invisible(self))
}

, errorCheck = function(executionCheck = FALSE
Expand All @@ -146,7 +146,7 @@ CustomFunctionModule <- R6::R6Class("CustomFunctionModule"
UpDraftSettings$errorLogger("fun must be a reference to a function")
}

return(invisible(NULL))
return(invisible(self))
}

, getFuncObj = function() {
Expand Down Expand Up @@ -193,7 +193,7 @@ CustomFunctionModule <- R6::R6Class("CustomFunctionModule"
, args = args
, funcName = self$getName())

return(NULL)
return(invisible(NULL))
}
)

Expand Down
6 changes: 3 additions & 3 deletions R/module_package_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ PackageFunctionModule <- R6::R6Class("PackageFunctionModule"
private$assignedProcesses <- assignedProcesses
}

self$errorCheck()
return(self$errorCheck())
}

, clearOutputCache = function() {
Expand All @@ -148,7 +148,7 @@ PackageFunctionModule <- R6::R6Class("PackageFunctionModule"

private$futurePromise <- NULL

return(invisible(NULL))
return(invisible(self))
}

, errorCheck = function(executionCheck = FALSE
Expand All @@ -170,7 +170,7 @@ PackageFunctionModule <- R6::R6Class("PackageFunctionModule"
UpDraftSettings$errorLogger("assignedProcesses must be a single whole number numeric")
}

return(NULL)
return(invisible(self))
}

, getName = function() {
Expand Down
14 changes: 7 additions & 7 deletions R/workflow_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"
private$connections <- list()
private$graph <- igraph::graph.empty()

self$errorCheck()
return(self$errorCheck())
}

, addConnections = function(connections) {
Expand Down Expand Up @@ -225,7 +225,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"
})
}

return(invisible(NULL))
return(invisible(self))
}

, addModules = function(modules) {
Expand All @@ -251,7 +251,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"
})
}

return(invisible(NULL))
return(invisible(self))
}

, errorCheck = function(executionCheck = FALSE
Expand Down Expand Up @@ -301,7 +301,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"
}
}

return(NULL)
return(invisible(self))
}

, getWorkflowInputs = function() {
Expand Down Expand Up @@ -440,7 +440,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"

private$connections[connection] <- NULL

return(NULL)
return(invisible(self))
}

, removeModule = function(module) {
Expand All @@ -461,7 +461,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"
, names(igraph::E(private$graph)))
private$connections[connectionsLost] <- NULL

return(NULL)
return(invisible(self))
}

, save = function(filename) {
Expand All @@ -482,7 +482,7 @@ DAGWorkflow <- R6::R6Class("DAGWorkflow"

write(jsonlite::toJSON(workflowData), filename)

return(NULL)
return(invisible(self))
}

, visualize = function() {
Expand Down

0 comments on commit db8bb9b

Please sign in to comment.