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

Changed several methods to return invisible(self) to allow chaining #21

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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