Skip to content

Delegation of methods - #63

Merged
dblock merged 1 commit into
codegram:masterfrom
dblock:delegation-of-methods
Sep 30, 2014
Merged

dblock merged 1 commit into
codegram:masterfrom
dblock:delegation-of-methods

Conversation

@dblock

@dblock dblock commented Sep 26, 2014

Copy link
Copy Markdown
Collaborator

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
@dblock
dblock force-pushed the delegation-of-methods branch from 1ee17c9 to af7de24 Compare September 27, 2014 15:03
@oriolgual

Copy link
Copy Markdown
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.

2 participants