File: asJSON.classRepresentation.R

package info (click to toggle)
r-cran-jsonlite 1.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: ansic: 3,792; sh: 9; makefile: 6
file content (10 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
# classRepresentation is an object that defines an S4 class encoding it usually
# doesn't serve much purpose, however as we don't wnat to encode it as a regular
# S4 data object.

# it currently only encodes the slots. we could add encoding of methods of that
# would be desired.

setMethod("asJSON", "classRepresentation", function(x, ...) {
  return(asJSON(attributes(x)$slots, ...))
})