Skip to content
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

Delegation of methods #63

Merged
merged 1 commit into from
Sep 30, 2014
Merged

Conversation

dblock
Copy link
Collaborator

@dblock dblock commented Sep 26, 2014

This is a backward-incompatible change that removes the need to specify navigational elements when resolving properties. Things like links are renamed as _links and embed renamed as _embed, which is what they are called in HAL. Here're a few examples of what you can do with this change.

Instead Of Write This
api._links.posts_categories api.posts_categories
api.links.posts.embedded.posts.first api.posts.first
api._links.post._expand(id: 3).first api.post(id: 3).first

I think this goes a long way into making clients really productive with an API and abstract away the fact that the API is a HAL one. This also opens the door to implementing other JSON format support without needing to rewrite client code, because navigational elements are something specific to HAL.

@dblock dblock mentioned this pull request Sep 26, 2014
@dblock dblock force-pushed the delegation-of-methods branch 2 times, most recently from fae47c9 to 1ee17c9 Compare September 26, 2014 18:36
@oriolgual
Copy link
Member

👍

dblock added a commit that referenced this pull request Sep 30, 2014
@dblock dblock merged commit 762d5c8 into codegram:master Sep 30, 2014
@dblock dblock deleted the delegation-of-methods branch September 30, 2014 15:35
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.

None yet

2 participants