I'm trying to build a set of APIs using Rails and Grape. The User model like below:
{
"email": "foo@bar.com"
"name": "Foo Bar"
}
Now, at the API presentation level, I want a user object be like:
{
"object": "User"
"email": "foo@bar.com"
"name": "Foo Bar"
}
Since I'm using Grape Entity gem to expose my models, hence the question really is: How to add an extra CONSTANT-value attribute to a Grape Entity class? Appreciate your help!