Skip to content

Commit

Permalink
further fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 17, 2018
1 parent e3182b0 commit 3f25005
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions R/ISOCitation.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,35 @@ ISOCitation<- R6Class("ISOCitation",

#setTitle
setTitle = function(title){
if(!(is.na(title) || is(title,"character") || is(title,"ISOAnchor"))){
classPass <- TRUE
if(is.null(title)){
classPass <- FALSE
}else{
if(!inherits(title,"ISOAbstractObject")){
if(!(is.na(title) || is(title, "character"))) classPass <- FALSE
}else{
if(is(title,"ISOAnchor")){ classPass <- TRUE }else{ classPass <- FALSE }
}
}
if(!classPass){
stop("Title should be an object of class 'character' or 'ISOAnchor'")
}
self$title <- title
},

#setAlternateTitle
setAlternateTitle = function(alternateTitle){
if(!(is.na(alternateTitle) || is(alternateTitle,"character") || is(alternateTitle,"ISOAnchor"))){
classPass <- TRUE
if(is.null(alternateTitle)){
classPath <- FALSE
}else{
if(!inherits(alternateTitle,"ISOAbstractObject")){
if(!(is.na(alternateTitle) || is(alternateTitle, "character"))) classPass <- FALSE
}else{
if(is(alternateTitle,"ISOAnchor")){ classPass <- TRUE }else{ classPass <- FALSE }
}
}
if(!classPass){
stop("Alternate title should be an object of class 'character' or 'ISOAnchor'")
}
self$alternateTitle <- alternateTitle
Expand Down

0 comments on commit 3f25005

Please sign in to comment.