digitalocean/droplet_kit

Creating tags

kylekyle opened this issue · 2 comments

The 2.0 documentation suggests a tag would be created like this:

client.tags.create(name: 'my_tag')

But that gives the error:

ArgumentError: {:name=>"my_tag"} does not respond to name, so we can't map it

Passing an OpenStruct works, but seems like a hack:

client.tags.create(OpenStruct.new(name: 'my_tag'))

Thanks @kylekyle, you're right, a DropletKit::Tag object should be passed instead of a hash. I've opened #123 to update the docs.

And #123 mentions the right way to handle it :)