jonthegeek / rapid

R 'API' documents
https://rapid.api2r.org/
Other
6 stars 1 forks source link

`rapid` is S7_object? #89

Closed jimrothstein closed 5 months ago

jimrothstein commented 5 months ago

As a(n) WHO, I WHAT, so that WHY.

Little confusing (to me, as new to Rapid and new to S7)

Why is class for rapid named class_rapid ?

From S7 vignettes, I thought new class is created like so:

There is no class_dog.

# dog is a function, contructor
dog =  S7::new_class("dog", properties = ....<snip>)

# create instance of class dog
lola = dog("lola", properties ...<snip>)

SEE:
https://rconsortium.github.io/S7/articles/S7.html

jonthegeek commented 5 months ago

Arguments like info = info() caused issues. Differentiating the constructor from what it represent avoided bugs and made everything less confusing. I'll try to write up a blog illustrating why I did this at some point.

jimrothstein commented 5 months ago

Got it ... just needed to work S7 & its terminology.

I supposed you might feel the point is not to need to delve into S7. For those unable to refrain, perhaps a fewer points/comments might be welcome.

Will collect various S7 objects you use. Reviewing your tests/testthat/test-zz-rapid.R (checking s3, s7, etc)