Skip to content

Commit

Permalink
refactor: use inherits() (#249)
Browse files Browse the repository at this point in the history
* bump version

* re-document

* prefer inherits() to string-comparison

* add NEWS bullet

* bump version
  • Loading branch information
ijlyttle committed Dec 31, 2023
1 parent c2f023f commit b43b566
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: boxr
Type: Package
Title: Interface for the 'Box.com API'
Version: 0.3.6.9002
Version: 0.3.6.9003
Authors@R: c(
person("Brendan", "Rocks", email = "foss@brendanrocks.com",
role = c("aut")),
Expand Down Expand Up @@ -67,7 +67,7 @@ Suggests:
usethis,
covr
VignetteBuilder: knitr
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RdMacros: lifecycle
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# boxr 0.3.6 (development)

## Internal

* update to use `inherits()` (vs. string-comparison) to determine class-membership. (#246)

* harmonizes the default location for tokens.
Now, `~` resolves to the home directory for all platforms.
A patch is applied offering to move tokens from "old" locations.
Expand Down
2 changes: 1 addition & 1 deletion R/boxr__internal_dir_comparison.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ box_dir_diff <- function(dir_id = box_getwd(), local_dir = getwd(), load = "up",
to_update <- behind <- data.frame()
}

if (class(absent) != "data.frame")
if (!inherits(absent, "data.frame"))
absent <- data.frame()

# The final list to output
Expand Down
4 changes: 2 additions & 2 deletions R/boxr__internal_get.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
handle_file_id <- function(obj) {
if (class(obj) == "boxr_file_reference") {
if (inherits(obj, "boxr_file_reference")) {
# If the user's submitted a file reference object, extract the id for them
file_id <- obj$id
} else if (class(obj) == "boxr_object_list") {
} else if (inherits(obj, "boxr_object_list")) {
# If the user's submitted a list of objects, extract the id from the first,
# and emit a message so they know what's up
if(length(obj) > 1)
Expand Down
4 changes: 3 additions & 1 deletion man/box_auth.Rd

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

0 comments on commit b43b566

Please sign in to comment.