Skip to content

Look for method on entity before calling on object #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2013

Conversation

MichaelXavier
Copy link
Contributor

Instead of trying to instance eval the block in a way that operates at the instance, it seemed much cleaner and more like idiomatic OOP to have exposures try methods on the instance before trying them on the wrapped object. This is a pattern you'll find in Roar as well.

Resolves #28

@@ -5,7 +5,7 @@ Next Release
* [#18](https://github.com/intridea/grape-entity/pull/18): Add `safe` option to `expose`, will not raise error for a missing attribute - [@fixme](https://github.com/fixme).
* [#16](https://github.com/intridea/grape-entity/pull/16): Add `using` option to `expose SYMBOL BLOCK` - [@fahchen](https://github.com/fahchen).
* [#24](https://github.com/intridea/grape-entity/pull/24): Return documentation with `as` param considered - [@drakula2k](https://github.com/drakula2k).
* Your contribution here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't kill this line.

@dblock
Copy link
Member

dblock commented Oct 15, 2013

There's a merge conflict, please merge from upstream. I'd also appreciate if you could please squash these commits into one.

@MichaelXavier
Copy link
Contributor Author

Whoops. My bad! Fixed the changelog, squashed into 1 commit, rebased from usptream/master and force pushed to my feature branch. Hopefully that was the correct process. Please let me know if there's any further issues that come up.

@dblock
Copy link
Member

dblock commented Oct 15, 2013

Love it, lets merge.

dblock added a commit that referenced this pull request Oct 15, 2013
Look for method on entity before calling on object
@dblock dblock merged commit e2f6dc8 into ruby-grape:master Oct 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate expose block in instance context
2 participants