REST API vs. the Ruby API

From the discourse_api README:

Over time this project intends to have a full Discourse API. At the moment there are only a few endpoints available

Reopening the module where you are placing your code and adding your method there might work. Have a look at the second example here: modules_and_classes - Documentation for Ruby 2.3.0. Another option would be to make a pull request to have your code added to the gem.