How to add body parameter to Serel gem (stackoverflow api)
In fact, when I try to access a question using the serel gem (which is a ruby wrapper for the stackoverflow api), I get an object with no body parameter included.
questions = Serel::Question.find(id)
see http://api.stackoverflow.com/1.1/usage/methods/questions-by-ids . Accordingly, we need to set the body parameter to true.
How to enable the "body" parameter true.
+3
Prateek Papriwal
source
to share
2 answers
So I finally figured it out, this should work for you:
Serel::Question.filter(:withbody).find(id)
+3
marcamillion
source
to share
Try the following:
questions = Serel::Question.find(id).body.get
0
codeit
source
to share