Open yuuu opened 6 years ago
I want to respond to the specified object itself.
If you program as follows, you will get an error with no body method.
body
class BodyEntity < Grape::ENtity expose :body end get do present 'success', with: Entities::BodyEntity end
As a workaround, we currently program as follows.
class BodyEntity < Grape::ENtity expose :body do |body| body end end get do present 'success', with: Entities::BodyEntity end
Is not there a better way?
If I understand you correctly, I think expose :itself, as: :body would work and is slightly prettier. Does that help?
expose :itself, as: :body
I want to respond to the specified object itself.
If you program as follows, you will get an error with no
body
method.As a workaround, we currently program as follows.
Is not there a better way?