Skip to content

Commit

Permalink
#14 imprint, #15 partof metadata methods
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jul 1, 2019
1 parent df3bc06 commit 06f4128
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
40 changes: 40 additions & 0 deletions R/ZenodoRecord.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,21 @@
#' \item{\code{setConferenceSessionPart(part)}}{
#' Set conference session part, object of class \code{\link{character}}.
#' }
#' \item{\code{setImprintPublisher(publisher)}}{
#' Set imprint publisher, object of class \code{\link{character}}.
#' }
#' \item{\code{setImprintISBN(isbn)}}{
#' Set imprint ISBN, object of class \code{\link{character}}.
#' }
#' \item{\code{setImprintPlace(place)}}{
#' Set imprint place, object of class \code{\link{character}}.
#' }
#' \item{\code{setPartofTitle(title)}}{
#' Set the book title in case of a chapter, object of class \code{\link{character}}.
#' }
#' \item{\code{setPartofPages(pages)}}{
#' Set the page numbers of book, object of class \code{\link{character}}.
#' }
#' }
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
Expand Down Expand Up @@ -709,6 +724,31 @@ ZenodoRecord <- R6Class("ZenodoRecord",
#setConferenceSessionPart
setConferenceSessionPart = function(part){
self$metadata$conference_session_part <- part
},

#setImprintPublisher
setImprintPublisher = function(publisher){
self$metadata$imprint_publisher <- publisher
},

#setImprintISBN
setImprintISBN = function(isbn){
self$metadata$imprint_isbn <- isbn
},

#setImprintPlace
setImprintPlace = function(place){
self$metadata$imprint_place <- place
},

#setPartofTitle
setPartofTitle = function(title){
self$metadata$partof_title <- title
},

#setPartofPages
setPartofPages = function(pages){
self$metadata$partof_pages <- pages
}

)
Expand Down
15 changes: 15 additions & 0 deletions man/ZenodoRecord.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion tests/testthat/test_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ test_that("create and deposit record",{
myrec$setConferenceSession("I")
myrec$setConferenceSessionPart("1")
myrec$setConferenceUrl("http://www.google.com")

myrec$setImprintPublisher("The Publisher")
myrec$setImprintISBN("isbn")
myrec$setImprintPlace("location")
myrec$setPartofTitle("Book title")
myrec$setPartofPages("1-30")

expect_equal(myrec$metadata$title, "My publication title")
expect_equal(myrec$metadata$description, "A description of my publication")
Expand Down

0 comments on commit 06f4128

Please sign in to comment.