pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
154 stars 24 forks source link

droplets_new() should return id #35

Closed hadley closed 10 years ago

hadley commented 10 years ago

So that you can pass that object to other droplet methods. (Or use S3 dispatch and add a droplet class)

...

Oh I think the problem is that you've built the chaining around "droplets" object, whereas I think building it around a single droplet would make more sense

sckott commented 10 years ago

I think that makes sense to have the "droplets" object include a single droplet

hadley commented 10 years ago

I'd probably write something like:

as.droplet <- function(x) UseMethod("as.droplet")

as.droplet.droplet <- function(x) x
as.droplet.numeric <- function(x) droplet(x)
as.droplet.character <- function(x) ...
hadley commented 10 years ago

Now returns a droplet object.