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

Add support for arrays of Links #27

Merged
merged 1 commit into from
Apr 3, 2013

Conversation

rehevkor5
Copy link
Contributor

  • Added support for arrays of Links in the _links area, as defined in HAL standard (_links => { name => [{href => ''}, {href => ''}]})

For example, see the "admin" link from the HAL standard:

{
  "_links": {
    "self": { "href": "/orders" },
    ...,
    "admin": [
      { "href": "/admins/2", "title": "Fred" },
      { "href": "/admins/5", "title": "Kate" }
    ]
  },
  currentlyProcessing: 14,
  shippedToday: 20,
  "_embedded": {
   ...
  }
}

… HAL standard (_links => { name => [{href => ''}, {href => ''}]})
@@ -13,13 +13,24 @@ class LinkCollection < Collection
# Public: Initializes a LinkCollection.
#
# collection - The Hash with the links.
# entry_point - The EntryPoint object to inject the cofnigutation.
# entry_point - The EntryPoint object to inject the configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

LOL, @oriolgual's typing abilities are shown here :trollface:

Thanks! :)

Copy link
Member

Choose a reason for hiding this comment

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

It was an easter egg :P

@mrcasals
Copy link
Contributor

mrcasals commented Apr 3, 2013

Looks good to me, let's ping @oriolgual and see what he thinks about this :)

@oriolgual
Copy link
Member

Thanks for your contrib @rehevkor5! Didn't know there was support for array Links.

oriolgual added a commit that referenced this pull request Apr 3, 2013
@oriolgual oriolgual merged commit 6ebcb47 into codegram:master Apr 3, 2013
@rehevkor5
Copy link
Contributor Author

@mrcasals @oriolgual Thanks for the quick review and acceptance!

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.

3 participants